Question For Language Lawyers - WAS: Re: Combining colon statementson one line?

Erik Max Francis max at alcyone.com
Tue Jul 20 03:31:51 CEST 2004


Tim Daneliuk wrote:

>     It is really good style to depend upon boolean True and False
>     being 1 and 0?  It seems to me that, especially in an OO
>     language, True and False ought to be treated as abstract
>     boolean objects.  In particular, assuming they are 1 and 0
>     (it seems to me) promotes something about the language
>     _implementation) into the application code which is a Bad
>     Thing.

In some they are abstract.  In Python, for backward compatibility (i.e.,
the past conventional use of 'True' and 'False' names), bool is actually
a subclass of int:

> I actually resort to this sort of stuff to keep
>     things as abstract as possible:
> 
>              F = 1 == 0
>              T = not F

Well this is certainly not possible when True and false are builtins.

-- 
 __ Erik Max Francis && max at alcyone.com && http://www.alcyone.com/max/
/  \ San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis
\__/ No need to tell me lies / Am I losing you
    -- Chante Moore



More information about the Python-list mailing list