On Wed, 29 Sep 2010 08:53:17 -0400 Philip Semanchuk
<phi...@semanchuk.com> wrote:

> Does Python make any guarantee that int(True) == 1 and int(False) ==
> 0 will always hold, or are their values an implementation detail?
> 

<http://docs.python.org/release/3.1/reference/datamodel.html#the-standard-type-hierarchy>

Booleans (bool)

    These represent the truth values False and True. The two objects
    representing the values False and True are the only Boolean
    objects. The Boolean type is a subtype of the integer type, and
    Boolean values behave like the values 0 and 1, respectively, in
    almost all contexts, the exception being that when converted to a
    string, the strings "False" or "True" are returned, respectively.


/W


-- 
INVALID? DE!

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to