File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -5251,6 +5251,11 @@ def test_nested_annotated_with_unhashable_metadata(self):
52515251 self .assertEqual (X .__origin__ , List [Annotated [str , {"unhashable_metadata" }]])
52525252 self .assertEqual (X .__metadata__ , ("metadata" ,))
52535253
5254+ def test_compatibility (self ):
5255+ # Test that the _AnnotatedAlias compatibility alias works
5256+ self .assertTrue (hasattr (typing_extensions , "_AnnotatedAlias" ))
5257+ self .assertIs (typing_extensions ._AnnotatedAlias , typing ._AnnotatedAlias )
5258+
52545259
52555260class GetTypeHintsTests (BaseTestCase ):
52565261 def test_get_type_hints (self ):
Original file line number Diff line number Diff line change @@ -4095,7 +4095,7 @@ def evaluate_forward_ref(
40954095 )
40964096
40974097
4098- # Aliases for items that have always been in typing .
4098+ # Aliases for items that are in typing in all supported versions .
40994099# Explicitly assign these (rather than using `from typing import *` at the top),
41004100# so that we get a CI error if one of these is deleted from typing.py
41014101# in a future version of Python
@@ -4136,3 +4136,6 @@ def evaluate_forward_ref(
41364136cast = typing .cast
41374137no_type_check = typing .no_type_check
41384138no_type_check_decorator = typing .no_type_check_decorator
4139+ # This is private, but it was defined by typing_extensions for a long time
4140+ # and some users rely on it.
4141+ _AnnotatedAlias = typing ._AnnotatedAlias
You can’t perform that action at this time.
0 commit comments