Although True, False are builtin constants, the following is allowed in Python.
>>> True = False
>>> a = True
>>> b = False
>>> print a,b
False False
Any reference of why this is allowed?
EDIT: This happens only in Python 2.x (as all pointed out).
Keep in mind that this only happens in versions of Python that were before python 3. This was part of Python’s philosophy that everything should be dynamic.
In fact in Python 2
Trueis not a keyword. It is a reference bound to aboolobject. You can try it in your python 2.x vm:In python 3 it is changed to a keyword, and trying to rebind the reference results in an exception: