Issue 31362: "async" and "await" are not keyword (original) (raw)
Issue31362
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) * ![]() |
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:51 | admin | set | github: 75543 |
2017-09-06 07:52:33 | Conor Cal | set | status: open -> closedmessages: + stage: resolved |
2017-09-06 06:39:13 | ammar2 | set | nosy: + ammar2messages: + |
2017-09-06 06:33:15 | Conor Cal | set | resolution: duplicate |
2017-09-06 06:26:21 | Conor Cal | set | messages: + |
2017-09-06 06:24:27 | Conor Cal | set | type: behavior |
2017-09-06 06:20:02 | Conor Cal | create |