Re: Revisiting Generators and Subgenerators

2010-03-26 Thread Cameron Simpson
On 26Mar2010 07:29, Sebastien Binet wrote: | On Mar 25, 10:39 pm, Winston wrote: | > A Baton object for generators to allow subfunction to yield, and to | > make them symetric. | | isn't a Baton what CSP calls a channel ? I was thinking about this (roughly) in the shower this morning before see

Re: Revisiting Generators and Subgenerators

2010-03-26 Thread Winston
On Mar 26, 7:29 am, Sebastien Binet wrote: > > Proposal for a new Generator Syntax in Python 3K-- > > A Baton object for generators to allow subfunction to yield, and to > > make > > them symetric. > > isn't a Baton what CSP calls a channel ? > > there is this interesting PyCSP library (which impl

Re: Revisiting Generators and Subgenerators

2010-03-26 Thread Sebastien Binet
On Mar 25, 10:39 pm, Winston wrote: > Here's my proposal again, but hopefully with better formatting so you > can read it easier. > > -Winston > - > > Proposal for a new Generator Syntax in Python 3K-- > A Baton object for generators to allow subfunction to yield, and to > make > t

Re: Revisiting Generators and Subgenerators

2010-03-26 Thread Steve Holden
Winston wrote: [...] > This new syntax for a generator will break all existing > programs. But we happen to be at the start of Python 3K where > new paradaigms are > being examined. However good your idea may be, I suspect this one sentence will kill it. We are no longer "at the s

Re: Revisiting Generators and Subgenerators

2010-03-25 Thread Stefan Behnel
Patrick Maupin, 26.03.2010 04:30: ... and then re-post your document. ... preferably to the python-ideas mailing list. Although it seems to me that this is something that could be explored as a library first - which usually means that people will tell you exactly that on python-ideas and ask

Re: Revisiting Generators and Subgenerators

2010-03-25 Thread Patrick Maupin
On Mar 25, 7:31 pm, Winston Wolff wrote: (a bunch of stuff about coroutines) There have been proposals in the past for more full-featured generators, that would work as general purpose coroutines. Among other things, there were issues with exception propagation, and the design was deliberately

Re: Revisiting Generators and Subgenerators

2010-03-25 Thread Winston Wolff
Coroutines achieve very similar things to threads, but avoid problems resulting from the pre-emptive nature of threads. Specifically, a coroutine indicates where it will yield to the other coroutine. This avoids lots of problems related to synchronization. Also the lightweight aspect is apparent

Re: Revisiting Generators and Subgenerators

2010-03-25 Thread Cameron Simpson
On 25Mar2010 14:39, Winston wrote: | Here's my proposal again, but hopefully with better formatting so you | can read it easier. Having quickly read the Abstract and Motivation, why is this any better than a pair of threads and a pair of Queue objects? (Aside from co-routines being more lightweig

Revisiting Generators and Subgenerators

2010-03-25 Thread Winston
Here's my proposal again, but hopefully with better formatting so you can read it easier. -Winston - Proposal for a new Generator Syntax in Python 3K-- A Baton object for generators to allow subfunction to yield, and to make them symetric. Abstract Generators can be

Revisiting Generators and Subgenerators

2010-03-25 Thread Winston
I have been reading PEP 380 because I am writing a video game/ simulation in Jython and I need cooperative multitasking. PEP 380 hits on my problem, but does not quite solve it for me. I have the following proposal as an alternative to PEP380. I don't know if this is the right way for me to introdu