File tree 2 files changed +9
-1
lines changed
Filter options
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):
5251
5251
self .assertEqual (X .__origin__ , List [Annotated [str , {"unhashable_metadata" }]])
5252
5252
self .assertEqual (X .__metadata__ , ("metadata" ,))
5253
5253
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
+
5254
5259
5255
5260
class GetTypeHintsTests (BaseTestCase ):
5256
5261
def test_get_type_hints (self ):
Original file line number Diff line number Diff line change @@ -4095,7 +4095,7 @@ def evaluate_forward_ref(
4095
4095
)
4096
4096
4097
4097
4098
- # Aliases for items that have always been in typing .
4098
+ # Aliases for items that are in typing in all supported versions .
4099
4099
# Explicitly assign these (rather than using `from typing import *` at the top),
4100
4100
# so that we get a CI error if one of these is deleted from typing.py
4101
4101
# in a future version of Python
@@ -4136,3 +4136,6 @@ def evaluate_forward_ref(
4136
4136
cast = typing .cast
4137
4137
no_type_check = typing .no_type_check
4138
4138
no_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