[Twisted-Python] need help with waitForDeferred...

Andrew Bennetts andrew-twisted at puzzling.org
Tue May 10 03:18:41 MDT 2005


On Tue, May 10, 2005 at 10:25:10AM +0200, Thomas Jung wrote:
> Hi everybody,
> 
> I am new to twisted, and still experimenting.
> Found the following code somewhere, looks very interesting,
> but when I run the script (python 2.3.3), just nothing happens....
> What am I missing ?
[...]
> 
> @defer.deferredGenerator
> def find(needle):

The @decorator syntax is new in Python 2.4, so you'd get a SyntaxError if
you tried to run this under Python 2.3.

It works as expected for me with Python 2.4 and Twisted 2.0: it prints

    I got my first deferred result
    I found 'foo!' at character 29

and then hangs.

-Andrew.





More information about the Twisted-Python mailing list