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