New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
keyword module missing async and await keywords #70452
Comments
I had a look at the *Lib/keyword.py* module. It seems like the auto generated *kwlist* is missing the *await* and *async* keywords. The keyword module generates the *kwlist* from *Python/graminit.c*. |
Nick, Victor, thoughts? |
What happened in cases like “with” and “yield”, when these names were turned into reserved keywords depending on a __future__ statement? |
It shouldn't go into keywords.py until it is actually a keyword. Keywords is used for many purposes including syntax highlighting and code analysis tools. |
To answer my question, it looks like the keywords.py list is automatically generated (by running the script) from Python/graminit.c, in turn generated from Grammar/Grammar. “Yield” and “with” were always listed even when the __future__ statement was needed to enable them (2.2 and 2.5). But currently ASYNC and AWAIT are in Grammar as what I believe are special tokens, rather than normal keywords. Depending on the purpose of the syntax highlighting or code analysis, it might be better for these to be listed as keywords now, rather than waiting until 3.7. |
I agree, especially considering that it takes time before syntax highlighters update their keywords list and users update their syntax highlighters. Would this be doable, considering that the list is generated automatically? Are there any other downsides in doing it? |
This is out-of-date for 3.5 and almost so for 3.6 and not an issue for 3.7. The PR has been closed. And I agree with Raymond that keywords.py should not anticipate the future. All this is aside from the auto-generation issue. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: