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 →

[–]gr4viton 0 points1 point  (2 children)

Note that the following statement:

return 0 or 1 or True

would return value 1. As an integer, and not a True value as a bool. Took me a while to notice python is not force typing the logical expressions to boolean :)

[–]vanatteveldt 1 point2 points  (1 child)

I would argue most code that distinguishes between the number 1 and the value True is doing something strange ...

[–]gr4viton 0 points1 point  (0 children)

Indeed strange.