[Python-ideas] Make len() usable on a generator

random832 at fastmail.us random832 at fastmail.us
Fri Oct 10 20:39:54 CEST 2014


On Fri, Oct 10, 2014, at 14:10, Chris Angelico wrote:
> On Sat, Oct 11, 2014 at 5:06 AM,  <random832 at fastmail.us> wrote:
> > Why doesn't it define a length? No, hear me out. Is there any reason
> > that, for example, generator expressions on lists or ranges shouldn't be
> > read-only views instead of generators?
> 
> For a start, you'd have to preclude anything with an 'if' in it.

Okay, and? (I couldn't remember if the "if" feature was a real feature
or a proposed on, or I would have mentioned it.)


More information about the Python-ideas mailing list