Message297312
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:15 | rhettinger | set | recipients:
+ rhettinger, docs@python, thomassen |
2017-06-29 20:19:15 | rhettinger | set | messageid: <1498767555.63.0.341893267565.issue30803@psf.upfronthosting.co.za> |
2017-06-29 20:19:15 | rhettinger | link | issue30803 messages |
2017-06-29 20:19:15 | rhettinger | create | |
|