[Python-Dev] Re: PEP 285: Adding a bool type

Alex Martelli aleax at aleax.it
Wed Apr 3 01:18:46 EST 2002


Paul Rubin wrote:

> "John Roth" <johnroth at ameritech.net> writes:
>> I absolutely agree. For me, the entire point is providing
>> a **standard** way of expressing **in the code** the
>> notion that a particular variable only takes two values:
>> True and False. This is such a common case that it deserves
>> to be promoted to be a part of the language.
> 
> Why not ask for enumeration types then?

Enumeration types would be VERY nice to have.  But I
would NOT want x<y, x in y, x is y, and so on, to return
values from an enumeration type...

Besides, having enumerations, or booleans, would *NOT*
"express in the code the notion that a particular variable
only takes [N] values".  For that, you'd need some kind of
declaration.  Python does not have declarations: and THAT
is what this requirement of Mr Roth amounts to.  There is
no way in Python to "express in the code" any such
constraint on a variable -- that's part of why Python is
so GREAT.  I hope Python stays pythonic... there are so
many languages which appear to be mostly about imposing
constraints ("expressing constraints in the code"), why can't
we keep ONE language whose point is instead that of
letting us be happily productive...?-)


Alex




More information about the Python-list mailing list