[Python-ideas] Should bool continue to inherit from int?

Alexander Belopolsky alexander.belopolsky at gmail.com
Wed Jan 21 20:49:20 CET 2015


On Wed, Jan 21, 2015 at 2:11 PM, Guido van Rossum <guido at python.org> wrote:

> 2) Do most Python users still agree that arithmetic operations should be
>> supported on booleans?
>>
>
> It would be so massively backward compatible that it's not worth thinking
> about.
>

The only time I encountered a situation where True + True was not 2 was in
numpy:

>>> numpy.bool_(True) + True
True

That was *very* inconvenient!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20150121/b919eb29/attachment.html>


More information about the Python-ideas mailing list