On 15/06/2013 00:06, Nobody wrote:
On Fri, 14 Jun 2013 16:49:11 +0000, Steven D'Aprano wrote:

Unlike Javascript though, Python's idea of truthy and falsey is actually
quite consistent:

Beyond that, if a user-defined type implements a __nonzero__() method then
it determines whether an instance is true or false. If it implements a
__len__() method, then an instance is true if it has a non-zero length.

It's __nonzero__ in Python 2, __bool__ in Python 3.
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to