This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: "async" and "await" are not keyword
Type: behavior Stage: resolved
Components: asyncio Versions: Python 3.6
process
Status: closed Resolution: duplicate
Dependencies: Superseder:
Assigned To: Nosy List: Conor Cal, ammar2, yselivanov
Priority: normal Keywords:

Created on 2017-09-06 06:20 by Conor Cal, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (4)
msg301443 - (view) Author: Conor Cal (Conor Cal) Date: 2017-09-06 06:20
"async" and "await" became kaywords in CPython 3.6. but in the keyword library, they are not in kwlist, and will return False by iskeyword method.
msg301444 - (view) Author: Conor Cal (Conor Cal) Date: 2017-09-06 06:26
"async" and "await" became kaywords in CPython 3.6. But they are not in kwlist of the keyword library, and will return False by iskeyword method.
msg301445 - (view) Author: Ammar Askar (ammar2) * (Python committer) Date: 2017-09-06 06:39
For what its worth, "async" and "await" are special keywords. They only act as keywords under certain situations by the tokenizer. You can read more about this here: https://www.python.org/dev/peps/pep-0492/#transition-plan

As far as I am aware, this special casing exists even in the latest version: https://github.com/python/cpython/blob/master/Parser/tokenizer.c#L1553-L1588
msg301453 - (view) Author: Conor Cal (Conor Cal) Date: 2017-09-06 07:52
thanks Ammar Askar, I also find this Issue is duplidcate, Issue 26264 has the same question. So I'll just close this oen.
History
Date User Action Args
2022-04-11 14:58:51adminsetgithub: 75543
2017-09-06 07:52:33Conor Calsetstatus: open -> closed

messages: + msg301453
stage: resolved
2017-09-06 06:39:13ammar2setnosy: + ammar2
messages: + msg301445
2017-09-06 06:33:15Conor Calsetresolution: duplicate
2017-09-06 06:26:21Conor Calsetmessages: + msg301444
2017-09-06 06:24:27Conor Calsettype: behavior
2017-09-06 06:20:02Conor Calcreate