diff options
author | Lysandros Nikolaou <lisandrosnik@gmail.com> | 2020-05-01 06:27:52 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-30 20:27:52 -0700 |
commit | 3e0a6f37dfdd595be737baae00ec0e036a912615 (patch) | |
tree | 42c810af16c6e84aa38aa31c30aebd1d0a9671f3 /Python/getopt.c | |
parent | eb0d359b4b0e14552998e7af771a088b4fd01745 (diff) | |
download | cpython-git-3e0a6f37dfdd595be737baae00ec0e036a912615.tar.gz |
bpo-40334: Add support for feature_version in new PEG parser (GH-19827)
`ast.parse` and `compile` support a `feature_version` parameter that
tells the parser to parse the input string, as if it were written in
an older Python version.
The `feature_version` is propagated to the tokenizer, which uses it
to handle the three different stages of support for `async` and
`await`. Additionally, it disallows the following at parser level:
- The '@' operator in < 3.5
- Async functions in < 3.5
- Async comprehensions in < 3.6
- Underscores in numeric literals in < 3.6
- Await expression in < 3.5
- Variable annotations in < 3.6
- Async for-loops in < 3.5
- Async with-statements in < 3.5
- F-strings in < 3.6
Closes we-like-parsers/cpython#124.
Diffstat (limited to 'Python/getopt.c')
0 files changed, 0 insertions, 0 deletions