True

François Pinard pinard at iro.umontreal.ca
Mon Aug 4 06:17:37 EDT 2003


[Daniel Klein]

> So my question is what is the proper method for setting booleans in 2.3?

Hi, Daniel.

In 2.3, you do not need to set booleans, `True' and `False' are just there.

However, if you have a need to write portably against many versions, you
might try something like:

    try:
        True
    except NameError:
        False, True = range(2)

in modules where you need to use `True' or `False'.

-- 
François Pinard   http://www.iro.umontreal.ca/~pinard





More information about the Python-list mailing list