[Python-iterators] RE: PEP 255: Simple Generators

Tim Peters tim.one at home.com
Fri Jun 15 17:05:02 EDT 2001


[Tim]
> For a very simple example,
>
> def genid_func(i):
>     while 1:
>         yield i
>         i += 1
>
> getid = genid(5).next

Make that line

  getid = genid_func(5).next

instead.

It was correct when I posted it, but the PSU Ministry of Bot Oversi





More information about the Python-list mailing list