True inconsistency in Python
Erik Max Francis
max at alcyone.com
Thu Nov 13 17:46:21 EST 2003
Borcis wrote:
> there's the equivalent, and more explicit :
>
> if bool(var)==True : blah
The explicitness here does not gain you anything. In a truth context,
x, bool(x), and bool(x) == True are all precisely identical. There is
absolutely no value gained by writing bool(x) == True instead of just x.
--
Erik Max Francis && max at alcyone.com && http://www.alcyone.com/max/
__ San Jose, CA, USA && 37 20 N 121 53 W && &tSftDotIotE
/ \
\__/ The golden rule is that there are no golden rules. -- George
Bernard Shaw
More information about the Python-list
mailing list