55from contextlib import contextmanager
66from mypy .ordered_dict import OrderedDict
77
8- from typing import Callable , List , Optional , Set , Tuple , Iterator , TypeVar , Iterable
8+ from typing import Callable , List , Optional , Set , Tuple , Iterator , TypeVar , Iterable , Sequence
99from typing_extensions import Final
1010from mypy_extensions import DefaultNamedArg
1111
@@ -324,7 +324,8 @@ def get_omitted_any(self, typ: Type, fullname: Optional[str] = None) -> AnyType:
324324 disallow_any = not self .is_typeshed_stub and self .options .disallow_any_generics
325325 return get_omitted_any (disallow_any , self .fail , self .note , typ , fullname )
326326
327- def analyze_type_with_type_info (self , info : TypeInfo , args : List [Type ], ctx : Context ) -> Type :
327+ def analyze_type_with_type_info (
328+ self , info : TypeInfo , args : Sequence [Type ], ctx : Context ) -> Type :
328329 """Bind unbound type when were able to find target TypeInfo.
329330
330331 This handles simple cases like 'int', 'modname.UserClass[str]', etc.
@@ -951,7 +952,7 @@ def fix_instance(t: Instance, fail: MsgCallback, note: MsgCallback,
951952 else :
952953 fullname = t .type .fullname
953954 any_type = get_omitted_any (disallow_any , fail , note , t , fullname , unexpanded_type )
954- t .args = [ any_type ] * len (t .type .type_vars )
955+ t .args = ( any_type ,) * len (t .type .type_vars )
955956 return
956957 # Invalid number of type parameters.
957958 n = len (t .type .type_vars )
@@ -968,7 +969,7 @@ def fix_instance(t: Instance, fail: MsgCallback, note: MsgCallback,
968969 # Construct the correct number of type arguments, as
969970 # otherwise the type checker may crash as it expects
970971 # things to be right.
971- t .args = [ AnyType (TypeOfAny .from_error ) for _ in t .type .type_vars ]
972+ t .args = tuple ( AnyType (TypeOfAny .from_error ) for _ in t .type .type_vars )
972973 t .invalid = True
973974
974975
0 commit comments