[issue37831] bool(~True) == True

Mark Dickinson report at bugs.python.org
Mon Aug 12 14:28:32 EDT 2019


Mark Dickinson <dickinsm at gmail.com> added the comment:

There's also the minor annoyance that there isn't currently an obvious safe way to convert an integer-like thing to an actual int, to make sure that bools do the right thing in a numeric context. operator.index *ought* to be that obvious way, but it leaves bools untouched.

>>> operator.index(True)
True

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37831>
_______________________________________


More information about the Python-bugs-list mailing list