True/False value testing

Marko Rauhamaa marko at pacujo.net
Thu Jan 7 06:19:15 EST 2016


Chris Angelico <rosuav at gmail.com>:

> However, none of these will compare *equal* to the Boolean values True
> and False, save for the integers 1 and 0. In fact, True is a special
> form of the integer 1, and False is a special form of the integer 0;

Stirring the pot:

   >>> (2 < 3) is True
   True

but is that guaranteed?


Marko



More information about the Python-list mailing list