Generators and their next() and send() methods

Aaron Brady castironpi at gmail.com
Tue Nov 18 20:08:14 EST 2008


On Nov 18, 5:20 pm, Thomas Mlynarczyk <tho... at mlynarczyk-webdesign.de>
wrote:
> Aaron Brady schrieb:
>
> > And, if you don't intend to use 'myway' on 'listiterator's and such,
> > 'send( None )' is equivalent to 'next( )'.
>
> I didn't know that. But doesn't that impose a restriction somehow? It
> makes it impossible to send a None to a generator.

No, None is a valid value to use with send.  Not all iterators support
send.



More information about the Python-list mailing list