why can't a callback be called with a deferred?

Chris Withers <[email protected]> Tue, 19 Feb 2019 11:00:57 +0000
Newsgroups gmane.comp.python.twisted
Message-ID <[email protected]>
Hi All,

There's this assert:

https://github.com/twisted/twisted/blob/trunk/src/twisted/internet/defer.py#L459

...and I'd like to understand why it's there.

I have what feels like a legitimate case where that assert trips me up, 
as I'd like to change this line:

https://github.com/cjw296/carly/blob/d39e316aa0f9e05613c263410e7b3ba5bcacba3a/carly/hook.py#L67

...to just return result.value. However, if the method being hooked 
returns a deferred, then I trip the assert.
Unfortunately, the commit that introduced that assert is just a one 
liner from Itamar back in 2003 without any context of what problem lead 
him to introduce the change.

Of course, I can work around it, was more curious than anything...

Chris

_______________________________________________
Twisted-Python mailing list
[email protected]
https://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python