Elevate `None`, `True`, and `False` to keyword status
In #282, it was observed that None, True, and False are merely predeclared names, not keywords, so it's legal to shadow them:
>>> None, True, False = 1, 2, 3
>>> None + True + False
6
I remember this used to be true in older versions of Python, but current Python bans assignment to any of these names. The current Python grammar makes them part of the syntax (the literal_expr node).
Assigning to these names hurts readability, since everyone expects them to be universal constants. Banning assignment is technically a backwards incompatible change, but a quick search of google3 indicates it's unlikely anyone is relying on this.
This FR does not propose any change to the present ability to shadow other predeclareds like len.
@alandonovan any objections?
Fine by me, but only because Python did it, and limited itself to these three names. In general, retroactively reserving words is (as you point out) a breaking change.
I think we didn't bother with this because no one cares about this (mostly theoretical) edge case.
People are more likely to redefine e.g. str by accident (as it could be a useful variable name), but this problem can be handled by a linter. So you could also have the linter detect redefinitions of True, False, None, if you think it can happen.
Either way, feel free to make them keywords or not; no one will notice. :)