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

Tim Daneliuk tundra at tundraware.com
Tue Jul 20 02:30:06 CEST 2004


Phil Frost wrote:
> newdate = date + (1000,2000)[ date < 500 ]

OK, this is clever, but I have a question for the Language Lawyers
here:

    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.   I actually resort to this sort of stuff to keep
    things as abstract as possible:

             F = 1 == 0
             T = not F



I-Haven't-Read-The-Language-Spec-In-This-Area-ly Yours,
----------------------------------------------------------------------------
Tim Daneliuk     tundra at tundraware.com
PGP Key:         http://www.tundraware.com/PGP/



More information about the Python-list mailing list