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 mark.dickinson, nodakai, rhettinger, serhiy.storchaka, terry.reedy, tim.peters
Date 2019-06-28.22:04:25
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1561759466.24.0.981110074164.issue37427@roundup.psfhosted.org>
In-reply-to
Content
Not a bug.  Both function docs say "reverse is a boolean value."
https://docs.python.org/3/library/stdtypes.html#boolean-values
says "Boolean values are the two constant objects False and True."  These should be used in new code.

For compatibility with old code, CPython generally allows 0 and 1.  In this case, it allows any 'integral value', but I would not necessarily expect this of other implementations.

[In general, the *Python language* docs do not document extra latitude allowed by the *CPython implementation*.  So the lack thereof here is also not a bug.]

All objects without fancy trickery have a __bool__ method, either inherited from *object* or overridden.  This in no way makes all such objects, including Xs, into boolean values.
History
Date User Action Args
2019-06-28 22:04:26terry.reedysetrecipients: + terry.reedy, tim.peters, rhettinger, mark.dickinson, serhiy.storchaka, nodakai
2019-06-28 22:04:26terry.reedysetmessageid: <1561759466.24.0.981110074164.issue37427@roundup.psfhosted.org>
2019-06-28 22:04:26terry.reedylinkissue37427 messages
2019-06-28 22:04:25terry.reedycreate