Python Language Incompatibilities moving from Python 2 to Python 3 True, False and None


Example

In Python 2, True, False and None are built-in constants. Which means it's possible to reassign them.

Python 2.x2.0
True, False = False, True
True   # False
False  # True

You can't do this with None since Python 2.4.

Python 2.x2.4
None = None  # SyntaxError: cannot assign to None

In Python 3, True, False, and None are now keywords.

Python 3.x3.0
True, False = False, True  # SyntaxError: can't assign to keyword

None = None  # SyntaxError: can't assign to keyword