Re: Coroutines: unexpected behaviour

2010-06-16 Thread Jérôme Mainka
On 16 juin, 20:11, Carl Banks wrote: > I suggest, if you intend to use this kind of thing in real code (and I > would not recommend that) that you get in a habit of explicitly > closing the generator after the last send(), even when you don't think > you have to. Very clear explanation. Thanks f

Re: Coroutines: unexpected behaviour

2010-06-16 Thread Jérôme Mainka
On Jun 16, 6:35 pm, Steven D'Aprano wrote: > How bizarre is that? Sure... > I have to say that your code is horribly opaque and unclear to me. Welcome to the coroutines world :-) This is mainly a pipeline where each function suspends execution waiting for data (yield), and feeding other functi

Coroutines: unexpected behaviour

2010-06-16 Thread Jérôme Mainka
Hello, I try to experiment with coroutines and I don't understand why this snippet doesn't work as expected... In python 2.5 and python 2.6 I get the following output: 0 Exception exceptions.TypeError: "'NoneType' object is not callable" in ignored The TypeError exception comes from the pprint