News for hackers. Stuff that matters.
Re:Python Idioms [pdf] by mattbot5000 on Thursday January 30, 2014 @12:44PM (#7152007)
He's referring to the special methods available to classes that allow implementation of the truth value of an object. In version 2.x of Python, this method is __nonzero__[1] and in version 3.x it's called __bool__[2]

[1] http://docs.python.org/2/reference/datamodel.html#object.__n...

[2] http://docs.python.org/3/reference/datamodel.html#object.__b...

There are no comments on this comment yet.