Re: PEP 342 misunderstanding

2006-10-08 Thread Jean-Paul Calderone
On 8 Oct 2006 12:33:02 -0700, [EMAIL PROTECTED] wrote: >So I've been reading up on all the new stuff in PEP 342, and trying to >understand its potential. So I'm starting with a few simple examples to >see if they work as expected, and find they dont. > >I'm basically trying to do the following: > >

Re: PEP 342 misunderstanding

2006-10-08 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: def printrange(): > ... for x in range(10): > ... x = yield x > ... print x > ... g = printrange() for x in g: > ... g.send(x*2) > ... > 0 > 1 > None > 4 > 3 > None > 8 > 5 > None > 12 > 7 > None > 16 > 9 > None > > Now, I was expect