[Python-Dev] PEP 340 -- concept clarification
Phillip J. Eby
pje at telecommunity.com
Wed May 4 02:47:41 CEST 2005
At 05:17 PM 5/3/05 -0700, Guido van Rossum wrote:
>(So do you want this feature now or not? Earlier you said it was no big deal.)
It *isn't* a big deal; but it'd still be nice, and I'd happily volunteer to
do the actual implementation of the 'close()' method myself, because it's
about the same amount of work as updating PEP 333 and sorting out any
political issues that might arise therefrom. :)
>But I kind of doubt that it's an issue; you'd have to have a
>try/except catching StopIteration around a yield statement that
>resumes the generator before this becomes an issue, and that sounds
>extremely improbable.
But it does exist, alas; see the 'itergroup()' and 'xmap()' functions of
this cookbook recipe:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/66448/
Or more pointedly, the 'roundrobin()' example in the Python 2.4 documentation:
http://www.python.org/doc/lib/deque-recipes.html
And there are other examples as well:
http://www.faqts.com/knowledge_base/view.phtml/aid/13516
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/141934
More information about the Python-Dev
mailing list