Terry J. Reedy <tjre...@udel.edu> added the comment:
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. ---------- title: None.__bool__ docstring is wrong -> Builtin __bool__ docstrings are wrong _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue46732> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com