2 ms·
The point is they shouldn't be. Knuth argues against implicitly treating bool as int in Concrete Mathematics.
by cma 8y ago
The point is they shouldn't be. Knuth argues against implicitly treating bool as int in Concrete Mathematics.
- DasIch 8y agoAgreed, however you have to take context into account. Python 2 didn't always have a bool type (granted, already a mistake), before it was introduced int was used instead. Making bool a subclass of int made it possible to use it even in combination with earlier code, which made adopting it trivial. If bool wouldn't be a subclass of int, some projects probably would still be using int instead of bool.