Boolean idioms (was Re: re Challenge: More Compact?)

Tim Daneliuk tundra at tundraware.com
Mon Jul 16 13:50:02 EDT 2001


Aahz Maruch wrote:
> 
> In article <mailman.995247446.16415.python-list at python.org>,
> Tim Peters <tim.one at home.com> wrote:
> >
> >Well, it's un-Pythonic to try to emulate Perl undef via Python None; it's
> >idiomatic to return 0 for false and 1 for true, [...]
> 
> I know that it's a frequent Python idiom to use 0/1, but where is it
> specifically un-Pythonic to use None/1?
> --
>                       --- Aahz  <*>  (Copyright 2001 by aahz at pobox.com)
> 
> Hugs and backrubs -- I break Rule 6                 http://www.rahul.net/aahz/
> Androgynous poly kinky vanilla queer het Pythonista
> 
> "How come we choose from just two people for President but more than 50
> for Miss America?"  --AEN

Well, in the spirit of really being anal-retentive, I use:

FALSE =  1==0
TRUE  = not FALSE


-- 
------------------------------------------------------------------------------
Tim Daneliuk
tundra at tundraware.com



More information about the Python-list mailing list