[Twisted-Python] __nonzero__ for Deferred

Tristan Seligmann mithrandi at mithrandi.net
Wed Mar 18 19:30:03 MDT 2015


On 19 March 2015 at 00:03, Glyph Lefkowitz <glyph at twistedmatrix.com> 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'm not sure offhand if I have any code that would be affected by
this, but I don't think I would have a problem considering any such
code incorrect. The most likely case I can think of is where I've
lazily written something like "if d" instead of "if d is not None".

That is to say, "+1".
-- 
mithrandi, i Ainil en-Balandor, a faer Ambar




More information about the Twisted-Python mailing list