On Wed, Aug 8, 2012 at 9:59 AM, Oleg Broytman <firstname.lastname@example.org>
To distinguish False and None for a tri-state variable that can have
On Thu, Aug 09, 2012 at 02:18:53AM +1000, Ben Finney <email@example.com
> What is a compelling use case for checking precisely for True or False?
3 values - "yes", "no" and "unspecified" - True, False and None in
I'd probably write that this way:
if t is None:
# not specified
on the other hand, if I had a variable that could be either a number or True/False, I would probably write:
if t is True:
elif t is False:
# use t as a number
just as I would for any other singleton value. Why does the PEP say that == True is preferred to is True?