[issue37831] bool(~True) == True

Serhiy Storchaka report at bugs.python.org
Wed Aug 14 04:15:14 EDT 2019


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

> Does anyone know what the rationale was for having & and | on bools return bools in the first place?

Besides the fact that they can be defined on bool in compatible way and these operators often are used for booleans?

It was in the initial version of PEP 285 and I have not found any questions or discussion about it.

----------
nosy: +gvanrossum

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


More information about the Python-bugs-list mailing list