Before python 2.3 (so it was actually not needed before), True and False did not exist and people were using 1 and 0 instead, sometimes assigning them to 'True' and 'False'.

Then, when they were added, some compatibility goo was added to make sure they compare equal to 1 and 0 to work with previous code.

If we ever want to move to python 3, we will have to drop all those equivalences though, and it's better to do it piece by piece since it is fully compatible with 2.6+.