Meta: PEP discussion (was Re: PEP 255: Simple Generators)
Greg Ewing
greg at cosc.canterbury.ac.nz
Wed Jun 27 20:35:04 EDT 2001
Tim Peters wrote:
>
> you can invoke a generator anywhere, but when invoked
> outside of a generative control context, the generator would yield its first
> result, and that's all.
To behave totally like Icon, it would be necessary
that given
def f():
return 3 + g()
where g is a generator, and f is called in an iteration
context, then f would be a generator too.
But then you would have turned Python into Icon. :-)
--
Greg Ewing, Computer Science Dept, University of Canterbury,
Christchurch, New Zealand
To get my email address, please visit my web page:
http://www.cosc.canterbury.ac.nz/~greg
More information about the Python-list
mailing list