[Python-ideas] Programming recommendations (PEP 8) and boolean values
fuzzyman at gmail.com
Thu Aug 9 00:04:22 CEST 2012
On 8 August 2012 17:59, Oleg Broytman <phd at phdru.name> wrote:
> On Thu, Aug 09, 2012 at 02:18:53AM +1000, Ben Finney <
> ben+python at benfinney.id.au> wrote:
> > What is a compelling use case for checking precisely for True or False?
> To distinguish False and None for a tri-state variable that can have
> 3 values - "yes", "no" and "unspecified" - True, False and None in
Or when testing, I often want to check that a method *really* returns True
or False rather than some object that happens to evaluate to True or False.
> Oleg Broytman http://phdru.name/ phd at phdru.name
> Programmers don't die, they just GOSUB without RETURN.
> Python-ideas mailing list
> Python-ideas at python.org
May you do good and not evil
May you find forgiveness for yourself and forgive others
May you share freely, never taking more than you give.
-- the sqlite blessing http://www.sqlite.org/different.html
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-ideas