From 29682eb73ed6af710941fabde18f4a5384bd58f4 Mon Sep 17 00:00:00 2001 From: baluyotraf Date: Fri, 17 Jul 2026 22:48:44 +0200 Subject: [PATCH 1/2] fix: move TypedDict from Python 3.13 to 3.15 --- testing/generate-typing-rewrite-info | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/testing/generate-typing-rewrite-info b/testing/generate-typing-rewrite-info index 7407e9b..ad2874a 100755 --- a/testing/generate-typing-rewrite-info +++ b/testing/generate-typing-rewrite-info @@ -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'}, @@ -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'}, } From 963a9ff63dc0f812290c23e0ca9f4ea0e20af1bf Mon Sep 17 00:00:00 2001 From: baluyotraf Date: Sat, 18 Jul 2026 01:42:49 +0200 Subject: [PATCH 2/2] fix: regenerate the main script after the typing replacement change --- reorder_python_imports.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/reorder_python_imports.py b/reorder_python_imports.py index 63ebc5d..d3c63da 100644 --- a/reorder_python_imports.py +++ b/reorder_python_imports.py @@ -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', @@ -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',