On Fri, Feb 17, 2017 at 1:55 PM, Joshua Morton <joshua.morto...@gmail.com>
wrote:

> but I'm wondering how common async and await were when that was proposed
> and accepted?


Actually, "async" and "await" are backwards compatible due to a clever
tokenizer hack. The "async" keyword may only appear in a few places (e.g.
async def), and it is treated as a name anywhere else.The "await" keyword
may only appear inside an "async def" and is treated as a name everywhere
else. Therefore...

    >>> async = 1
    >>> await = 1

...these are both valid in Python 3.5. This example is helpful when
proposing new keywords.

More info: https://www.python.org/dev/peps/pep-0492/#transition-plan
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to