On Fri, Feb 19, 2010 at 11:12 AM, Andrey Fedorov firstname.lastname@example.org wrote:
Since .next() seems to be equivalent to .send(None), why wasn't .next() just given an optional parameter which defaults to None?
Because for built-in iterator types the next() method is implemented in C and we didn't want to invalidate existing C code by giving it an optional argument.
But why do you care?
On Thu, Oct 1, 2009 at 1:10 PM, Simon Forman email@example.com wrote:
On Wed, Sep 30, 2009 at 4:24 PM, Andrey Fedorov firstname.lastname@example.org wrote:
As far as I can tell, a generator's .next() is equivalent to .send(None). Is this true?
They are equivalent AFAIK.
If so, [why] aren't they unified in a method with a single argument which defaults to None?
next() predates send().
Python-ideas mailing list Pythonemail@example.com http://mail.python.org/mailman/listinfo/python-ideas