Date

In response to Bob's post on unintuitive interfaces, consider, in Python:

>>>bool('False')
True
>>>bool(str(False))
True

Huh?

>>>bool(eval('False'))
False
>>>bool(eval(str(False)))
False

Ah, that's better. Apparently I'm not the only person to get bitten by this.



Comments

comments powered by Disqus