PEP 255: Simple Generators

Marcin 'Qrczak' Kowalczyk qrczak at knm.org.pl
Wed Jun 20 17:38:24 EDT 2001


Wed, 20 Jun 2001 11:42:08 -0700, David Eppstein <eppstein at ics.uci.edu> pisze:

> I'm wondering if it wouldn't make sense to allow a non-empty return 
> statement in a generator, with the semantics that the object being returned 
> is itself some kind of iterator that is used to continue the sequence.
> 
> i.e.
>     def integers(i):
>         yield i
>         return integers(i+1)

I like it.

-- 
 __("<  Marcin Kowalczyk * qrczak at knm.org.pl http://qrczak.ids.net.pl/
 \__/
  ^^                      SYGNATURA ZASTĘPCZA
QRCZAK



More information about the Python-list mailing list