Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions reorder_python_imports.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ def _fix_file(

# GENERATED VIA generate-typing-rewrite-info
# Using:
# flake8-typing-imports==1.12.0
# flake8-typing-imports==1.13.0
# mypy-extensions==0.4.3
# typing-extensions==4.3.0
REPLACES[(3, 6)].update((
Expand All @@ -434,7 +434,6 @@ def _fix_file(
'typing_extensions=typing:TYPE_CHECKING',
'typing_extensions=typing:Text',
'typing_extensions=typing:Type',
'typing_extensions=typing:get_type_hints',
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please read the PR I linked you to and the comment directly above this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you referring to a comment in the code, or a comment in the linked PR? Either way I'm not sure what you mean, but I did make one change I noticed that the linked PR did too.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the comment in the code that says "this is generated" -- aka you shouldn't edit it manually

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've removed the changes to generated code.

))
REPLACES[(3, 7)].update((
'mypy_extensions=typing:NoReturn',
Expand All @@ -456,6 +455,7 @@ def _fix_file(
))
REPLACES[(3, 9)].update((
'typing_extensions=typing:Annotated',
'typing_extensions=typing:get_type_hints',
))
REPLACES[(3, 10)].update((
'typing_extensions=typing:Concatenate',
Expand Down
2 changes: 2 additions & 0 deletions testing/generate-typing-rewrite-info
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@ else:

# --- typing_extensions notes ---
# https://github.com/python/typing_extensions#other-notes-and-limitations
# - Starting with Python 3.9, get_type_hints() has the include_extra parameter
# - get_origin and get_args lack support for Annotated in Python 3.8
# and lack support for ParamSpecArgs and ParamSpecKwargs in 3.9.
# - Starting with 3.11, NamedTuple and TypedDict can inherit from Generic
# - @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.
CUSTOM_TYPING_EXT_SYMBOLS = {
(3, 9): {'get_type_hints'},
(3, 10): {'get_origin', 'get_args'},
(3, 11): {'NamedTuple', 'TypedDict', 'final', 'overload'},
}
Expand Down