@@ -357,12 +357,16 @@ def _looks_like_special_alias(node: Call) -> bool:
357357 PY39: Callable = _CallableType(collections.abc.Callable, 2)
358358 """
359359 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+ )
366370 )
367371
368372
@@ -400,10 +404,8 @@ def infer_special_alias(
400404
401405def _looks_like_typing_cast (node : Call ) -> bool :
402406 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" )
407409 )
408410
409411
0 commit comments