@@ -357,12 +357,16 @@ def _looks_like_special_alias(node: Call) -> bool:
357
357
PY39: Callable = _CallableType(collections.abc.Callable, 2)
358
358
"""
359
359
return isinstance (node .func , Name ) and (
360
- node .func .name == "_TupleType"
361
- and isinstance (node .args [0 ], Name )
362
- and node .args [0 ].name == "tuple"
363
- or node .func .name == "_CallableType"
364
- and isinstance (node .args [0 ], Attribute )
365
- and node .args [0 ].as_string () == "collections.abc.Callable"
360
+ (
361
+ node .func .name == "_TupleType"
362
+ and isinstance (node .args [0 ], Name )
363
+ and node .args [0 ].name == "tuple"
364
+ )
365
+ or (
366
+ node .func .name == "_CallableType"
367
+ and isinstance (node .args [0 ], Attribute )
368
+ and node .args [0 ].as_string () == "collections.abc.Callable"
369
+ )
366
370
)
367
371
368
372
@@ -400,10 +404,8 @@ def infer_special_alias(
400
404
401
405
def _looks_like_typing_cast (node : Call ) -> bool :
402
406
return isinstance (node , Call ) and (
403
- isinstance (node .func , Name )
404
- and node .func .name == "cast"
405
- or isinstance (node .func , Attribute )
406
- and node .func .attrname == "cast"
407
+ (isinstance (node .func , Name ) and node .func .name == "cast" )
408
+ or (isinstance (node .func , Attribute ) and node .func .attrname == "cast" )
407
409
)
408
410
409
411
0 commit comments