Monday, May 18, 2015

false can be equal to True in Python

In Python 2.7 everything but an empty string and False itself evaluates to True. This also returns True:


(Pdb) bool('false')
True

(Pdb) bool(u'false')
True

No comments :

Post a Comment