A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2005-December/058486.html below:

[Python-Dev] Short-circuiting iterators

[Python-Dev] Short-circuiting iterators [Python-Dev] Short-circuiting iteratorsRaymond Hettinger raymond.hettinger at verizon.net
Wed Dec 7 03:58:50 CET 2005
[Matthew F. Barnes]  
> > > Perhaps it would be a useful addition to the itertools
> > > module then?
> > >
> > >         itertools.interruptable(iterable)

[Raymond Hettinger]
> > Any real-world use cases or compelling contrived examples?

[Simon Wittber]
> I use something like this in the nanothreads module.
> 
> http://metaplay.dyndns.org:8081/svn/fibranet/fibranet/nanothreads.py
> 
> This feature is implemented in the Fibra class, in the end and kill
> methods. It is used to stop an iterator from parts of the code which
> are not part of the loop that is actually iterating the iterator.
> 
> This usage is specific to situations where generators are being used
> as cooperative threads.

Are there any generator specific needs that are not met by the PEP 342
implementation?  Given a choice between throw(), close(), and send(), I
would have thought that all the bases have been covered.


Raymond

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4