Skip to content
Open
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
5 changes: 4 additions & 1 deletion reorder_python_imports.py
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,6 @@ def _fix_file(
'typing_extensions=typing:TypeIs',
'typing_extensions=typing:TypeVar',
'typing_extensions=typing:TypeVarTuple',
'typing_extensions=typing:TypedDict',
'typing_extensions=typing:get_protocol_members',
'typing_extensions=typing:is_protocol',
'typing_extensions=typing:runtime_checkable',
Expand All @@ -565,8 +564,12 @@ def _fix_file(
REPLACES[(3, 14)].update((
'typing_extensions=typing:evaluate_forward_ref',
))
REPLACES[(3, 15)].update((
'typing_extensions=typing:TypedDict',
))
# END GENERATED


# GENERATED VIA generate-typing-pep585-rewrites
REPLACES[(3, 9)].update((
'typing=collections.abc:AsyncGenerator',
Expand Down
6 changes: 5 additions & 1 deletion testing/generate-typing-rewrite-info
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ import typing_extensions
# the first one on py313+, and (Async)ContextManager now has an optional
# second parameter with a default value; typing_extensions backports these
# changes.
# - Python 3.15 adds the PEP-728 which allows closed and extra_items to be
# passed to TypedDict. Importing TypedDict via typing_extensions is now a
# valid case before 3.15.
CUSTOM_TYPING_EXT_SYMBOLS = {
(3, 9): {'get_type_hints'},
(3, 10): {'get_origin', 'get_args', 'Literal', 'NewType'},
Expand All @@ -53,9 +56,10 @@ CUSTOM_TYPING_EXT_SYMBOLS = {
},
(3, 13): {
'AsyncContextManager', 'ContextManager', 'AsyncGenerator', 'Generator',
'TypeVar', 'TypeVarTuple', 'ParamSpec', 'TypedDict', 'Protocol',
'TypeVar', 'TypeVarTuple', 'ParamSpec', 'Protocol',
'runtime_checkable',
},
(3, 15): {'TypedDict'},
}


Expand Down
Loading