True inconsistency in Python

David C. Fox davidcfox at post.harvard.edu
Thu Nov 13 00:28:00 EST 2003


Scott Chapman wrote:

> 
> if var == True: # only works if var is 1
>   blah
> 
> ' Must use:
> 
> if var: # works if var is not 0
>   blah

Just because something isn't True doesn't mean it isn't true.

David





More information about the Python-list mailing list