Skip to content

Commit 59f2e31

Browse files
authored
Merge pull request #1070 from PyCQA/py311
add python3.11 support (except* and a[*b])
2 parents 07be27e + e72afc5 commit 59f2e31

File tree

3 files changed

+28
-1
lines changed

3 files changed

+28
-1
lines changed

.github/workflows/main.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ jobs:
2929
py: 3.9
3030
toxenv: py
3131
- os: ubuntu-latest
32-
py: 3.10-dev
32+
py: '3.10'
33+
toxenv: py
34+
- os: ubuntu-latest
35+
py: '3.11-dev'
3336
toxenv: py
3437
- os: ubuntu-latest
3538
py: 3.9

pycodestyle.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,7 @@ def missing_whitespace_after_keyword(logical_line, tokens):
496496
keyword.iskeyword(tok0.string) and
497497
tok0.string not in SINGLETONS and
498498
tok0.string not in ('async', 'await') and
499+
not (tok0.string == 'except' and tok1.string == '*') and
499500
tok1.string not in ':\n'):
500501
yield tok0.end, "E275 missing whitespace after keyword"
501502

testsuite/python311.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#: Okay
2+
try:
3+
...
4+
except* OSError as e:
5+
pass
6+
#: Okay
7+
from typing import Generic
8+
from typing import TypeVarTuple
9+
10+
11+
Ts = TypeVarTuple('Ts')
12+
13+
14+
class Shape(Generic[*Ts]):
15+
pass
16+
17+
18+
def f(*args: *Ts) -> None:
19+
...
20+
21+
22+
def g(x: Shape[*Ts]) -> Shape[*Ts]:
23+
...

0 commit comments

Comments
 (0)