15.02.18 18:27, Guido van Rossum пише:
A thought just occurred to me. Maybe we should just add a Boolean class to numbers? It's a subclass of Integral, presumably.

Isn't bool a subclass of int only for historical reasons? I think that if bool was in Python from the beginning, it would not be an int subclass.

Operations inherited from int like division or bits shift doesn't make sense as boolean operations. The only boolean operations are testing for truthfulness, `not`, `and` and `or`. But every object in Python supports them. The bool class is just a type of constants True and False.

_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to