[Twisted-Python] Returning a Deferred as a result from another Deferred

Ryan Fugger rfugger at gmail.com
Fri Oct 5 22:00:51 EDT 2007


On 10/5/07, Jonathan Lange <jml at mumak.net> wrote:
> On 10/6/07, Ryan Fugger <rfugger at gmail.com> wrote:
> > Returning a Deferred as a result from another Deferred seems to be
> > disallowed by an assertion at the start of the callback chain.  Why is
> > this?  Right now I have worked around this limitation by wrapping my
> > Deferred in a list and then unwrapping it in the callback.
> >
>
> No it's not. I can guarantee this.
>
> What's the content of the AssertionError that you are getting?

No content in the error.  Line 238 of twisted/internet/defer.py (first
line in Deferred.callback) is:

assert not isinstance(result, Deferred)

That's pretty explicit in disallowing Deferreds...  I'm working with
the version 2.5 release.

Ryan




More information about the Twisted-Python mailing list