[issue37831] bool(~True) == True

Mark Dickinson report at bugs.python.org
Mon Aug 12 15:22:07 EDT 2019


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

> isn't `int()` the obvious way "to convert an integer-like thing to an actual int"?

Well sorta, except that it's too lenient, letting in strings, floats, Decimal instances and the like. The strings isn't so much of an issue - it's more the silent truncation with the floats and Decimals that's problematic.

----------

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


More information about the Python-bugs-list mailing list