[Python-Dev] Generator methods - "what's next" ?
firephoenix at wanadoo.fr
Sun Apr 5 13:31:48 CEST 2009
I'm a little confused by the recent changes to the generator system...
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...), which gives really weird (imo)
Browsing the web, I've found people troubled by that asymmetry, but no
remarks on its causes nor its future...
Since __next__(), send() and others have really really close semantics,
I consider that state as a python wart, one of the few real ones I can
Is there any plan to fix this ? Either by coming back to the next()
method, or by putting all the "magical methods" of generators in the
__specialattributes__ bag ?
Thanks a lot for the information,
More information about the Python-Dev