Re: [Twisted-Python] __nonzero__ for Deferred

2015-03-20 Thread Glyph
> On Mar 20, 2015, at 4:05 AM, Justin Mazzola Paluska wrote: > > On 03/18/2015 06:03 PM, Glyph Lefkowitz wrote: >> I'd like to deprecate and remove __nonzero__ on Deferreds. Occasionally I >> see code where someone (maybe even me) does "if d:" where they should have >> been doing "@d.addCallb

Re: [Twisted-Python] __nonzero__ for Deferred

2015-03-20 Thread Justin Mazzola Paluska
On 03/18/2015 06:03 PM, Glyph Lefkowitz wrote: I'd like to deprecate and remove __nonzero__ on Deferreds. Occasionally I see code where someone (maybe even me) does "if d:" where they should have been doing "@d.addCallback def cb(result): if result: ...". Anybody else have this issue? Object

Re: [Twisted-Python] __nonzero__ for Deferred

2015-03-19 Thread Glyph Lefkowitz
> On Mar 18, 2015, at 5:50 PM, exar...@twistedmatrix.com wrote: > > On 18 Mar, 10:03 pm, gl...@twistedmatrix.com wrote: >> I'd like to deprecate and remove __nonzero__ on Deferreds. Occasionally I >> see code where someone (maybe even me) does "if d:" where they should have >> been doing "@d.ad

Re: [Twisted-Python] __nonzero__ for Deferred

2015-03-18 Thread Tristan Seligmann
On 19 March 2015 at 00:03, Glyph Lefkowitz wrote: > I'd like to deprecate and remove __nonzero__ on Deferreds. By "remove" do you mean "add an implementation that raises an exception"? (It seems like this must be what you meant, I just wanted to be clear since this is a slightly subtle issue) I'

Re: [Twisted-Python] __nonzero__ for Deferred

2015-03-18 Thread exarkun
On 18 Mar, 10:03 pm, gl...@twistedmatrix.com wrote: I'd like to deprecate and remove __nonzero__ on Deferreds. Occasionally I see code where someone (maybe even me) does "if d:" where they should have been doing "@d.addCallback def cb(result): if result: ...". Anybody else have this issue? O

[Twisted-Python] __nonzero__ for Deferred

2015-03-18 Thread Glyph Lefkowitz
I'd like to deprecate and remove __nonzero__ on Deferreds. Occasionally I see code where someone (maybe even me) does "if d:" where they should have been doing "@d.addCallback def cb(result): if result: ...". Anybody else have this issue? Objections? -glyph _