On Mon, May 2, 2016 at 9:49 PM, Steven D'Aprano email@example.com wrote:
On Tue, May 03, 2016 at 01:41:08AM +0000, Joshua Morton wrote:
Right that makes sense. Is there any precedent for non-keywords being special cased by the compiler (I'm thinking specifically of Exceptions)?
For a while "as" was context sensitive, being treated as a keyword where necessary but still allowing you to use it as a variable name. In Python 2.5:
py> import math as as py> as <stdin>:1: Warning: 'as' will become a reserved keyword in Python 2.6 <module 'math' from '/usr/local/lib/python2.5/lib-dynload/math.so'>
I believe that the core devs have sworn the most terrible and bloody oaths to never allow abominations like this again...
async and await. Special-cased in certain contexts in 3.5 and 3.6 and will become reserved keywords in 3.7. 
(On a side note, I just ran Python 3.5.1 on Windows with -Wd, and neither async nor await print a DeprecationWarning or PendingDeprecationWarning when used as a name. Should they?)