This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rhettinger
Recipients docs@python, rhettinger, thomassen
Date 2017-06-29.20:19:15
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
This case was supposed to be covered by the last bullet point, "instances of user-defined classes, if the class defines a __bool__() or __len__() method, when that method returns the integer zero or bool value False.".  The word "user-defined" should be dropped.

Also, the whole section can be simplified to something like:

By default, objects are considered true unless they define either a __bool__ method that returns False or __len__ method that returns zero.  

Practically, this means that empty containers are false (such as [], (), {}, '', etc) and that numbers equal to zero are false (such as 0, 0.0, 0.0j, False, Decimal(0), Fractions(0, 1), etc).  Also, *None* is a false value.

Date User Action Args
2017-06-29 20:19:15rhettingersetrecipients: + rhettinger, docs@python, thomassen
2017-06-29 20:19:15rhettingersetmessageid: <>
2017-06-29 20:19:15rhettingerlinkissue30803 messages
2017-06-29 20:19:15rhettingercreate