Skip to content

Commit

Permalink
Merge pull request #302 from cdce8p/typing-extensions-4.4.0
Browse files Browse the repository at this point in the history
Update typing rewrites for typing_extensions 4.4.0
  • Loading branch information
asottile committed Oct 10, 2022
2 parents 284b9b7 + f20c1f2 commit ddf1074
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 1 addition & 2 deletions reorder_python_imports.py
Expand Up @@ -421,7 +421,7 @@ def _fix_file(
# Using:
# flake8-typing-imports==1.13.0
# mypy-extensions==0.4.3
# typing-extensions==4.3.0
# typing-extensions==4.4.0
REPLACES[(3, 6)].update((
'typing_extensions=typing:AsyncIterable',
'typing_extensions=typing:AsyncIterator',
Expand Down Expand Up @@ -459,7 +459,6 @@ def _fix_file(
))
REPLACES[(3, 10)].update((
'typing_extensions=typing:Concatenate',
'typing_extensions=typing:ParamSpec',
'typing_extensions=typing:ParamSpecArgs',
'typing_extensions=typing:ParamSpecKwargs',
'typing_extensions=typing:TypeAlias',
Expand Down
7 changes: 6 additions & 1 deletion testing/generate-typing-rewrite-info
Expand Up @@ -24,10 +24,15 @@ else:
# - @final was changed in Python 3.11 to set the .__final__ attribute
# - @overload was changed in Python 3.11 to make function overloads
# introspectable at runtime.
# - Any was change in Python 3.11 so it can be used as a base class
# - Considered for Python 3.12
# - PEP 695 infer_variance parameter for TypeVar
# - PEP 696 default parameter for TypeVar, TypeVarTuple, and ParamSpec
CUSTOM_TYPING_EXT_SYMBOLS = {
(3, 9): {'get_type_hints'},
(3, 10): {'get_origin', 'get_args'},
(3, 11): {'NamedTuple', 'TypedDict', 'final', 'overload'},
(3, 11): {'Any', 'NamedTuple', 'TypedDict', 'final', 'overload'},
(3, 12): {'ParamSpec', 'TypeVar', 'TypeVarTuple'},
}


Expand Down

0 comments on commit ddf1074

Please sign in to comment.