generator language design

Terry Reedy tjreedy at udel.edu
Sat Jan 11 00:35:54 CET 2003


"Johan Ovlinger" <johan at ccs.neu.edu> wrote in message
news:avnbsv$8lp$1 at camelot.ccs.neu.edu...
> Hello!
>
> I apologise for not posting to python-iterators, but the archives to
that list
> appear to be down, so it is unclear whether it is still active.

It served its purpose.

>  Most discussion about this issue happened 18 months ago, it seems.

That is when current scheme was designed.


> anyways, I was hoping someone could point me to the design rationale
behind
> defining generators to look like functions, rather than having
Generator be a
> subclass of Iterator, and letting the user subclass Generator to
create new
> generators?

Current design makes .next() calls to generator-iteraters *faster*
than a function call.  No argument processing, no frame setup.  Your
design would substitute for this *two* regular function calls.

Terry J. Reedy






More information about the Python-list mailing list