3 ms·
It would be more correct to say that the "bool" type implements an "__int__" method for conversion to an integer, but the types are actually distinct: >>>
by AlexandrB 12y ago
It would be more correct to say that the "bool" type implements an "__int__" method for conversion to an integer, but the types are actually distinct:
>>> type(True)
<type 'bool'>
>>> type(1)
<type 'int'>
Edit: oops, I'm wrong. "bool" also inherits from "int":
http://stackoverflow.com/questions/8169001/why-is-bool-a-subclass-of-int http://stackoverflow.com/questions/8169001/why-is-bool-a-sub...