PEP 255: Simple Generators

Neil Schemenauer nas at python.ca
Wed Jun 20 10:44:54 EDT 2001


Roman Suzi wrote:
> 
> Pipes instead of generators:
> 
> q = openpipe()   
> 
> def g(pipe):
>   for i in range(10):
>     pipe.put(i)        # this brings g into sleep till pipe is read
>   raise StopIter       # this will be raised where reading from pipeoccurs

AFAIK, something like this cannot be implemented in Jython.

  Neil




More information about the Python-list mailing list