@@ -345,7 +345,8 @@ def try_analyze_special_unbound_type(self, t: UnboundType, fullname: str) -> Opt
345
345
346
346
def get_omitted_any (self , typ : Type , fullname : Optional [str ] = None ) -> AnyType :
347
347
disallow_any = not self .is_typeshed_stub and self .options .disallow_any_generics
348
- return get_omitted_any (disallow_any , self .fail , self .note , typ , self .options .python_version , fullname )
348
+ return get_omitted_any (disallow_any , self .fail , self .note , typ ,
349
+ self .options .python_version , fullname )
349
350
350
351
def analyze_type_with_type_info (
351
352
self , info : TypeInfo , args : Sequence [Type ], ctx : Context ) -> Type :
@@ -1028,7 +1029,8 @@ def fix_instance(t: Instance, fail: MsgCallback, note: MsgCallback,
1028
1029
fullname = None # type: Optional[str]
1029
1030
else :
1030
1031
fullname = t .type .fullname
1031
- any_type = get_omitted_any (disallow_any , fail , note , t , python_version , fullname , unexpanded_type )
1032
+ any_type = get_omitted_any (disallow_any , fail , note , t , python_version , fullname ,
1033
+ unexpanded_type )
1032
1034
t .args = (any_type ,) * len (t .type .type_vars )
1033
1035
return
1034
1036
# Invalid number of type parameters.
@@ -1287,7 +1289,8 @@ def make_optional_type(t: Type) -> Type:
1287
1289
return UnionType ([t , NoneType ()], t .line , t .column )
1288
1290
1289
1291
1290
- def fix_instance_types (t : Type , fail : MsgCallback , note : MsgCallback , python_version : Tuple [int , int ]) -> None :
1292
+ def fix_instance_types (t : Type , fail : MsgCallback , note : MsgCallback ,
1293
+ python_version : Tuple [int , int ]) -> None :
1291
1294
"""Recursively fix all instance types (type argument count) in a given type.
1292
1295
1293
1296
For example 'Union[Dict, List[str, int]]' will be transformed into
@@ -1297,12 +1300,15 @@ def fix_instance_types(t: Type, fail: MsgCallback, note: MsgCallback, python_ver
1297
1300
1298
1301
1299
1302
class InstanceFixer (TypeTraverserVisitor ):
1300
- def __init__ (self , fail : MsgCallback , note : MsgCallback , python_version : Tuple [int , int ]) -> None :
1303
+ def __init__ (
1304
+ self , fail : MsgCallback , note : MsgCallback , python_version : Tuple [int , int ]
1305
+ ) -> None :
1301
1306
self .fail = fail
1302
1307
self .note = note
1303
1308
self .python_version = python_version
1304
1309
1305
1310
def visit_instance (self , typ : Instance ) -> None :
1306
1311
super ().visit_instance (typ )
1307
1312
if len (typ .args ) != len (typ .type .type_vars ):
1308
- fix_instance (typ , self .fail , self .note , disallow_any = False , python_version = self .python_version , use_generic_error = True )
1313
+ fix_instance (typ , self .fail , self .note , disallow_any = False ,
1314
+ python_version = self .python_version , use_generic_error = True )
0 commit comments