Re: [Twisted-Python] Some things I've learned: safer callbacks, better t.p.context

2016-10-19 Thread Kevin Conway
> What are you referring to as a "coroutine" here? A generator? Generator, yes, but used as a coroutine that both emits values and receives them. The introduction of dedicated coroutines in Python 3.5 is something I haven't updated my personal language for very well. Generator-coroutine is the

Re: [Twisted-Python] Some things I've learned: safer callbacks, better t.p.context

2016-10-19 Thread Glyph Lefkowitz
> On Oct 19, 2016, at 4:43 PM, Amber Hawkie Brown > wrote: > > One thing that I have still not figured out is how Futures (which are tightly > tied to an event loop) will possibly ever work over multiple event loops. I > think since you can't really chain them,

Re: [Twisted-Python] Some things I've learned: safer callbacks, better t.p.context

2016-10-19 Thread Glyph Lefkowitz
> On Oct 19, 2016, at 4:25 PM, Jean-Paul Calderone > wrote: > > It's also possible to write a little bit of testing library code and get both > versions of the test nearly for free. Unfortunately, I very rarely see test > suites written that way. I think many

Re: [Twisted-Python] Some things I've learned: safer callbacks, better t.p.context

2016-10-19 Thread Amber "Hawkie" Brown
> On 20 Oct. 2016, at 08:54, Glyph Lefkowitz wrote: > > >> On Oct 19, 2016, at 2:47 PM, Itamar Turner-Trauring > > wrote: >> >> On Wed, Oct 19, 2016, at 05:45 PM, Itamar Turner-Trauring wrote: >>> Well... I had a test

Re: [Twisted-Python] Some things I've learned: safer callbacks, better t.p.context

2016-10-19 Thread Jean-Paul Calderone
It's also possible to write a little bit of testing library code and get both versions of the test nearly for free. Unfortunately, I very rarely see test suites written that way. I think many people don't realize there are two cases to handle or believe testing both cases is too expensive for

Re: [Twisted-Python] Some things I've learned: safer callbacks, better t.p.context

2016-10-19 Thread Itamar Turner-Trauring
On Tue, Oct 18, 2016, at 03:44 PM, Glyph Lefkowitz wrote: > > I think Deferred as it is today is a pretty good compromise between > the two positions. On the one hand it is decoupled from the event > loop. On the other - and this is important - *no Deferred-returning > API will ever call your

Re: [Twisted-Python] Some things I've learned: safer callbacks, better t.p.context

2016-10-19 Thread Itamar Turner-Trauring
On Wed, Oct 19, 2016, at 05:45 PM, Itamar Turner-Trauring wrote: > Well... I had a test that went through synchronous Deferred path. And > yeah, it was easier to write than async test. But it failed to catch a > bug that was only in async case. So the problem I see is that > supporting both in

Re: [Twisted-Python] Some things I've learned: safer callbacks, better t.p.context

2016-10-19 Thread Glyph Lefkowitz
> On Oct 18, 2016, at 7:09 PM, Kevin Conway wrote: > > > making such aggressive use of private APIs that it could win a contest > > about how to ensure that you break on every new release of Twisted :) > > We're very aware of that! It's one of the reasons we have