Booleans (was Re: My .02 on PEP308 + an extra question)

Jeremy Fincher tweedgeezer at hotmail.com
Sun Mar 2 17:27:12 EST 2003


Stephen Horne <intentionally at blank.co.uk> wrote in message news:<11246vsuv438kr6ql0fjnihektdig2phac at 4ax.com>...
> I'm not clear on what the benefit now
> from adding a separate type is - except for the standard spelling and
> the declaration of intent (useful to human readers only) inherent in
> using that spelling.

I use config files for a program of mine that are basically the repr()
of a data structure that is eval()ed when the program starts.  Having
a bool type makes those config files much more readable and
human-editable than not, since it's much easier to understand the
intented of "locked=True" than "locked=1".  That's reason enough for
having a bool type, IMO -- in fact, I've even been using Guido's
Python proof-of-concept bool class in my application since True and
False are just names for integers in Python 2.2.

Jeremy




More information about the Python-list mailing list