File tree 3 files changed +12
-1
lines changed
Filter options
3 files changed +12
-1
lines changed
Original file line number Diff line number Diff line change @@ -42,6 +42,9 @@ aliases that have a `Concatenate` special form as their argument.
42
42
to reflect Python 3.13+ behavior: A value assigned to ` __total__ ` in the class body of a
43
43
` TypedDict ` will be overwritten by the ` total ` argument of the ` TypedDict ` constructor.
44
44
Patch by [ Daraan] ( https://github.com/Daraan ) , backporting a CPython PR by Jelle Zijlstra.
45
+ - Fix for Python 3.11 that now ` isinstance(typing_extensions.Unpack[...], TypeVar) `
46
+ evaluates to ` False ` , however still ` True ` for <3.11.
47
+ Patch by [ Daraan] ( https://github.com/Daraan )
45
48
46
49
# Release 4.12.2 (June 7, 2024)
47
50
Original file line number Diff line number Diff line change @@ -6172,6 +6172,12 @@ def test_equivalent_nested_variadics(self):
6172
6172
self .assertEqual (nested_tuple_bare , TupleAliasTsT [Unpack [Tuple [str , int ]], object ])
6173
6173
self .assertEqual (nested_tuple_bare , TupleAliasTsT [Unpack [Tuple [str ]], Unpack [Tuple [int ]], object ])
6174
6174
6175
+ @skipUnless (TYPING_3_11_0 , "Needed for backport" )
6176
+ def test_type_var_inheritance (self ):
6177
+ Ts = TypeVarTuple ("Ts" )
6178
+ self .assertFalse (isinstance (Unpack [Ts ], TypeVar ))
6179
+ self .assertFalse (isinstance (Unpack [Ts ], typing .TypeVar ))
6180
+
6175
6181
6176
6182
class TypeVarTupleTests (BaseTestCase ):
6177
6183
Original file line number Diff line number Diff line change @@ -2657,7 +2657,9 @@ def __init__(self, getitem):
2657
2657
self .__doc__ = _UNPACK_DOC
2658
2658
2659
2659
class _UnpackAlias (typing ._GenericAlias , _root = True ):
2660
- __class__ = typing .TypeVar
2660
+ if sys .version_info < (3 , 11 ):
2661
+ # needed for compatibility with Generic[Unpack[Ts]]
2662
+ __class__ = typing .TypeVar
2661
2663
2662
2664
@property
2663
2665
def __typing_unpacked_tuple_args__ (self ):
You can’t perform that action at this time.
0 commit comments