A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2009-April/088444.html below:

[Python-Dev] Generator methods - "what's next" ?

[Python-Dev] Generator methods - "what's next" ? [Python-Dev] Generator methods - "what's next" ?Firephoenix firephoenix at wanadoo.fr
Tue Apr 7 21:30:19 CEST 2009
Greg Ewing a écrit :
>
> Firephoenix wrote:
>
>> I basically agreed with renaming the next() method to __next__(), so 
>> as to follow the naming of other similar methods (__iter__() etc.).
>> But I noticed then that all the other methods of the generator had 
>> stayed the same (send, throw, close...)
>
> Keep in mind that next() is part of the iterator protocol
> that applies to all iterators, whereas the others are
> specific to generators. By your reasoning, any object that
> has any __xxx__ methods should have all its other methods
> turned into __xxx__ methods as well.
>

Indeed, I kind of mixed up generators with the wider family of iterators.

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4