[Twisted-Python] why can't a callback be called with a deferred?

Glyph glyph at twistedmatrix.com
Mon Feb 25 23:34:28 MST 2019



> On Feb 25, 2019, at 3:32 AM, Scott, Barry <barry.scott at forcepoint.com> wrote:
> 
> On Tuesday, 19 February 2019 11:00:57 GMT Chris Withers wrote:
>> 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.
> 
> We hit this assert when porting from very old twisted to current twisted.
> In all cases the problem was with our code that used deferreds in a poor, not
> well understood way. After refactoring we are a lot happier with the
> resulting code as it easier to maintain now.

Thanks for the feedback, Barry!

It would still be great to figure out, if we can, how we might make the error message a bit more legible to folks with less knowledge of Twisted's internals.

-g



More information about the Twisted-Python mailing list