PEP 318

Eyal Lotem gnupeaker at yahoo.com
Mon Mar 22 06:04:41 EST 2004


> Good point. Though to me, it isn't that it's a pain
> for the compiler
> to search for the 'yield' - I don't care about the
> compilers pain. The
> problem is that *I* have to look for the yield and
> might not notice
> it.
You are not supposed to be looking for it, IMHO.
Generators follow the Sequence protocol and are to be
treated as sequences.  Thus, you should simply make it
clear in the
function-name/conventions/interface-documentation that
the function returns a sequence.  Whether that
sequence is implemented via a generator or not is an
implementation detail.


__________________________________
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html




More information about the Python-list mailing list