(no subject)

Chad Netzer cnetzer at mail.arc.nasa.gov
Fri Jan 31 22:10:52 CET 2003

On Fri, 2003-01-31 at 11:41, mis6 at pitt.edu wrote:
> Subject: adding to __builtins__
> Consider the following script (I need it under Python 2.2, where True and
> False are undefined):


$ python
Python 2.2.2 (#1, Jan 18 2003, 10:18:59)
>>> True
>>> False

Was this not added in 2.2.0?

In any case, your truefalse.py should definitely check to see if True,
False are not already defined and exist in builtin, rather than just
forcibly adding them to __builtin__, since they might become keywords at
some point, or might not be allowed to be changed in __builtin__ (??).

Furthermore, they will become type bool, so it may be best to define
True = (1==1) and False = (0==1), or some such thing.

These things *might* be helpful for future compatibility (but are
probably overkill).

Bay Area Python Interest Group - http://www.baypiggies.net/

Chad Netzer
(any opinion expressed is my own and not NASA's or my employer's)

More information about the Python-list mailing list