Re: Python generators (coroutines)

2008-04-23 Thread rocco . rossi
> Anyway, if you have a blocking operation, the only solution is to use > a thread or a separate process. > > Michele Simionato That's what I thought. It was in fact rather obvious, but I wanted to be sure that I hadn't overlooked some arcane possibility (ex. with the use of exceptions or somet

Re: Python generators (coroutines)

2008-04-23 Thread Michele Simionato
On Apr 23, 8:26 pm, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > On Wed, 23 Apr 2008 10:53:03 -0700 (PDT), Michele Simionato: > You could have #2. It's a trivial variation of sending a value. For > example, > > http://twistedmatrix.com/trac/browser/trunk/twisted/internet/defer.py... > > Jean-

Re: Python generators (coroutines)

2008-04-23 Thread Jean-Paul Calderone
On Wed, 23 Apr 2008 10:53:03 -0700 (PDT), Michele Simionato <[EMAIL PROTECTED]> wrote: On Apr 23, 4:17 pm, [EMAIL PROTECTED] wrote: I would really like to know more about python 2.5's new generator characteristics that make them more powerful and analogous to coroutines. Is it possible for inst

Re: Python generators (coroutines)

2008-04-23 Thread Michele Simionato
On Apr 23, 4:17 pm, [EMAIL PROTECTED] wrote: > I would really like to know more about python 2.5's new generator > characteristics that make them more powerful and analogous to > coroutines. Is it possible for instance to employ them in situations > where I would normally use a thread with a blocki

Re: Python generators (coroutines)

2008-04-23 Thread Jean-Paul Calderone
On Wed, 23 Apr 2008 07:17:46 -0700 (PDT), [EMAIL PROTECTED] wrote: I would really like to know more about python 2.5's new generator characteristics that make them more powerful and analogous to coroutines. Is it possible for instance to employ them in situations where I would normally use a thre

Re: Python generators (coroutines)

2008-04-23 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: I would really like to know more about python 2.5's new generator characteristics that make them more powerful and analogous to coroutines. Is it possible for instance to employ them in situations where I would normally use a thread with a blocking I/O (or socket) opera

Python generators (coroutines)

2008-04-23 Thread rocco . rossi
I would really like to know more about python 2.5's new generator characteristics that make them more powerful and analogous to coroutines. Is it possible for instance to employ them in situations where I would normally use a thread with a blocking I/O (or socket) operation? If it is, could someone