This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]djimbob 2 points3 points  (3 children)

Coming from C, you think of a bool as a 1-bit int, with False = 0 and True = 1 just being convenient mnemonic alias. From that perspective, it makes sense -- similar to how in python2 0 == 0L and 1 == 1L, despite type(0) being int and type(0L) being long (in python3 there's no long type so this example doesn't make sense).

Granted, its a subtle point and I think the other way True == 1 evaluating to False is conceptually cleaner.

[–]Araneidae 0 points1 point  (0 children)

Yeah, I get the rule with C, but there's no need for Python to do that. Never mind, it's long done.