[Python-ideas] Merging a generator's "next" and "send" methods?

Andrey Fedorov anfedorov at gmail.com
Fri Feb 19 17:12:11 CET 2010


Since .next() seems to be equivalent to .send(None), why wasn't .next() just
given an optional parameter which defaults to None?

- Andrey

On Thu, Oct 1, 2009 at 1:10 PM, Simon Forman <sajmikins at gmail.com> wrote:

> On Wed, Sep 30, 2009 at 4:24 PM, Andrey Fedorov <anfedorov at gmail.com>
> 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?
> > - Andrey
>
> next() predates send().
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20100219/3d732603/attachment.html>


More information about the Python-ideas mailing list