@@ -123,6 +123,8 @@ def get_column(self) -> int:
123123 'typing.DefaultDict' : 'collections.defaultdict' ,
124124 'typing.Deque' : 'collections.deque' ,
125125 'typing.OrderedDict' : 'collections.OrderedDict' ,
126+ # HACK: a lie in lieu of actual support for PEP 675
127+ 'typing.LiteralString' : 'builtins.str' ,
126128}
127129
128130# This keeps track of the oldest supported Python version where the corresponding
@@ -137,12 +139,15 @@ def get_column(self) -> int:
137139 'typing.DefaultDict' : (2 , 7 ),
138140 'typing.Deque' : (2 , 7 ),
139141 'typing.OrderedDict' : (3 , 7 ),
142+ 'typing.LiteralString' : (3 , 11 ),
140143}
141144
142145# This keeps track of aliases in `typing_extensions`, which we treat specially.
143146typing_extensions_aliases : Final = {
144147 # See: https://github.com/python/mypy/issues/11528
145148 'typing_extensions.OrderedDict' : 'collections.OrderedDict' ,
149+ # HACK: a lie in lieu of actual support for PEP 675
150+ 'typing_extensions.LiteralString' : 'builtins.str' ,
146151}
147152
148153reverse_builtin_aliases : Final = {
@@ -156,6 +161,8 @@ def get_column(self) -> int:
156161_nongen_builtins .update ((name , alias ) for alias , name in type_aliases .items ())
157162# Drop OrderedDict from this for backward compatibility
158163del _nongen_builtins ['collections.OrderedDict' ]
164+ # HACK: consequence of hackily treating LiteralString as an alias for str
165+ del _nongen_builtins ['builtins.str' ]
159166
160167
161168def get_nongen_builtins (python_version : Tuple [int , int ]) -> Dict [str , str ]:
0 commit comments