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 terry.reedy
Recipients JelleZijlstra, terry.reedy
Date 2022-02-21.02:36:33
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1645410993.28.0.613371860137.issue46732@roundup.psfhosted.org>
In-reply-to
Content
For whatever reason, all builtins with a __bool__ method appear to share the same docstring.  For example,

>>> range.__bool__.__doc__
'self != 0'
>>> bool(range(0))
False
>>> bool(range(1))
True

The concrete collection classes have their lengths stored internally so bool use that via len(self).  But len(range) != 0 iff stop != start.
History
Date User Action Args
2022-02-21 02:36:33terry.reedysetrecipients: + terry.reedy, JelleZijlstra
2022-02-21 02:36:33terry.reedysetmessageid: <1645410993.28.0.613371860137.issue46732@roundup.psfhosted.org>
2022-02-21 02:36:33terry.reedylinkissue46732 messages
2022-02-21 02:36:33terry.reedycreate