global interpreter lock

Stephen Thorne stephen.thorne at
Thu Sep 15 04:46:32 CEST 2005

On 15/09/05, Michael Sparks <ms at> wrote:
> At the moment, one option that springs to mind is this:
>     yield WaitDataAvailable("inbox")

Twisted supports this.


example usage is:

def thingummy():
  thing = waitForDeferred(makeSomeRequestResultingInDeferred())
  yield thing
  thing = thing.getResult()
  print thing #the result! hoorj!

With the new generator syntax, it becomes somewhat less clunky,
allowing for the syntax:

def foo():
   somereturnvalue = yield SomeLongRunningOperation()
   print somereturnvalue

Stephen Thorne
Development Engineer

More information about the Python-list mailing list