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

2019-02-20 Thread Chris Withers
On 21/02/2019 07:32, Glyph wrote: Yeah, this is part of carly, that I posted earlier. It stems from the need to get the results of method calls when you have no reference to the object being calls, or sometimes a result that's a deferred you need to wait on, particularly in a test, but have

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

2019-02-20 Thread Glyph
> On Feb 20, 2019, at 11:03 PM, Chris Withers wrote: > > On 21/02/2019 06:55, Glyph wrote: >>> The methods being hooked don't necessarily return deferreds. > > Glyph, this bit ^^^ > >>> I'd like it to be an explicit choice of the caller, ie: >>> >>> result = yield SomeProtocol.onMessage.call

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

2019-02-20 Thread Chris Withers
On 21/02/2019 06:55, Glyph wrote: The methods being hooked don't necessarily return deferreds. Glyph, this bit ^^^ I'd like it to be an explicit choice of the caller, ie: result = yield SomeProtocol.onMessage.called() # okay, we got here, we know onMessage was called, # now we might want

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

2019-02-20 Thread Glyph
> On Feb 19, 2019, at 5:34 AM, Chris Withers wrote: > > On 19/02/2019 11:41, Adi Roiban wrote: >> >> I think it was introduced to catch some common bad usage patterns ... >> like yours :) > > Not a massively helpful comment. I think what Adi was trying to get at here is that this is exactly