[Python-Dev] Re: Re: anonymous blocks (original) (raw)
Terry Reedy tjreedy at udel.edu
Mon Apr 25 16:38:49 CEST 2005
- Previous message: [Python-Dev] Re: anonymous blocks
- Next message: [Python-Dev] Re: Re: anonymous blocks
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
"Nick Coghlan" <ncoghlan at gmail.com> wrote in message news:426CB7C2.8030508 at gmail.com...
Guido van Rossum wrote: > statement expansion", I think we can expect EXPR to produce a value > that is already an iterator (rather than merely an interable).
Not supporting iterables makes it harder to write a class which is inherently usable in a with block, though. The natural way to make iterable classes is to use 'yield' in the definition of iter - if iter() is not called, then that trick can't be used.
Would not calling iter() (or .iter) explicitly, instead of depending on the implicit call of for loops, suffice to produce the needed iterator?
tjr
- Previous message: [Python-Dev] Re: anonymous blocks
- Next message: [Python-Dev] Re: Re: anonymous blocks
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]