diff options
author | Anthony Sottile <asottile@umich.edu> | 2022-06-14 10:48:46 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-14 10:48:46 -0400 |
commit | 59f2e31d0f032ffccb0ad64761f58758a844796d (patch) | |
tree | a1012c062cc7cd54a534d6043d2dd8803669fdea | |
parent | 07be27e1b2bf9c29eed710a2f808d3db5a670139 (diff) | |
parent | e72afc551f1fa178cb753e1ec164803655ba5692 (diff) | |
download | pep8-59f2e31d0f032ffccb0ad64761f58758a844796d.tar.gz |
Merge pull request #1070 from PyCQA/py311
add python3.11 support (except* and a[*b])
-rw-r--r-- | .github/workflows/main.yml | 5 | ||||
-rwxr-xr-x | pycodestyle.py | 1 | ||||
-rw-r--r-- | testsuite/python311.py | 23 |
3 files changed, 28 insertions, 1 deletions
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0d26707..00f5e75 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -29,7 +29,10 @@ jobs: py: 3.9 toxenv: py - os: ubuntu-latest - py: 3.10-dev + py: '3.10' + toxenv: py + - os: ubuntu-latest + py: '3.11-dev' toxenv: py - os: ubuntu-latest py: 3.9 diff --git a/pycodestyle.py b/pycodestyle.py index adf743c..f866dd4 100755 --- a/pycodestyle.py +++ b/pycodestyle.py @@ -496,6 +496,7 @@ def missing_whitespace_after_keyword(logical_line, tokens): keyword.iskeyword(tok0.string) and tok0.string not in SINGLETONS and tok0.string not in ('async', 'await') and + not (tok0.string == 'except' and tok1.string == '*') and tok1.string not in ':\n'): yield tok0.end, "E275 missing whitespace after keyword" diff --git a/testsuite/python311.py b/testsuite/python311.py new file mode 100644 index 0000000..a405125 --- /dev/null +++ b/testsuite/python311.py @@ -0,0 +1,23 @@ +#: Okay +try: + ... +except* OSError as e: + pass +#: Okay +from typing import Generic +from typing import TypeVarTuple + + +Ts = TypeVarTuple('Ts') + + +class Shape(Generic[*Ts]): + pass + + +def f(*args: *Ts) -> None: + ... + + +def g(x: Shape[*Ts]) -> Shape[*Ts]: + ... |