Meta: PEP discussion (was Re: PEP 255: Simple Generators)
Steven D. Majewski
sdm7g at Virginia.EDU
Thu Jun 21 16:32:53 EDT 2001
On Wed, 20 Jun 2001, Tim Peters wrote:
> Heh. If you had only finished *your* generator implementation 9 years ago
> instead of getting sucked into the continuation pit, we could be using
>
> sdm f(i):
> suspend i+1
>
> today <wink>.
I think one of the bug missing pieces to make it fit smoothly into
Python was iterators.
My 'suspend value' actually got transformed into returning the tuple
(value, suspended-frame), so to use it in a loop required something
like:
iterf = function # don't mung up the global name
while 1:
value, iterf = iterf( args... )
... # first time, call the function
# all others, call the suspended activation frame
Back in those ancient pre-PEP days, Guido was much more conservative.
And there were fewer people to bounce ideas off of --- I recall I
was soliciting ideas for a more pythonic syntax, but there wasn't
much interest. ( And the above hack was even too ugly for ME to
defend! )
-- Steve
More information about the Python-list
mailing list