bool and int

Dino dino at no.spam.ar
Wed Jan 25 15:32:50 EST 2023


On 1/23/2023 11:22 PM, Dino wrote:
>  >>> b = True
>  >>> isinstance(b,bool)
> True
>  >>> isinstance(b,int)
> True
>  >>>

ok, I read everything you guys wrote. Everyone's got their reasons 
obviously, but allow me to observe that there's also something called 
"principle of least surprise".

In my case, it took me some time to figure out where a nasty bug was 
hidden. Letting a bool be a int is quite a gotcha, no matter how hard 
the benevolent dictator tries to convince me otherwise!





More information about the Python-list mailing list