Re: [Python-Dev] [issue6673] Py3.1 hangs in coroutine and eats up all memory

2009-08-13 Thread Stefan Behnel
Antoine Pitrou wrote: > Stefan Behnel behnel.de> writes: >> IMHO, that's pretty far from obvious when you look at the code. > > A "yield" wrapped in a list comprehension looks far from obvious IMO anyway, > whether in 2.x or 3.x. It's this kind of "smart" writing tricks people find > that > only

Re: [Python-Dev] [issue6673] Py3.1 hangs in coroutine and eats up all memory

2009-08-12 Thread Antoine Pitrou
Stefan Behnel behnel.de> writes: > > IMHO, that's pretty far from obvious when you look at the code. A "yield" wrapped in a list comprehension looks far from obvious IMO anyway, whether in 2.x or 3.x. It's this kind of "smart" writing tricks people find that only makes code more difficult to rea

Re: [Python-Dev] [issue6673] Py3.1 hangs in coroutine and eats up all memory

2009-08-12 Thread Stefan Behnel
Nick Coghlan wrote: > Stefan Behnel wrote: >> This is also an important issue for other Python implementations. Cython >> simply transforms comprehensions into the equivalent for-loop, so when we >> implement PEP 342 in Cython, we will have to find a way to emulate >> CPython's behaviour here (unle

Re: [Python-Dev] [issue6673] Py3.1 hangs in coroutine and eats up all memory

2009-08-12 Thread Nick Coghlan
Stefan Behnel wrote: > This is also an important issue for other Python implementations. Cython > simply transforms comprehensions into the equivalent for-loop, so when we > implement PEP 342 in Cython, we will have to find a way to emulate > CPython's behaviour here (unless we decide to stick with

Re: [Python-Dev] [issue6673] Py3.1 hangs in coroutine and eats up all memory

2009-08-12 Thread Stefan Behnel
[moving this from the bug tracker] Alexandre Vassalotti wrote: > Alexandre Vassalotti added the comment: > > Not a bug. > > The list comprehension in your chunker: > > while True: > target.send([ (yield) for i in range(chunk_size) ]) > > is equivalent to the following generator in