File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6231,9 +6231,13 @@ def find_type_equals_check(
62316231 compared
62326232 """
62336233
6234- def is_type_call (expr : CallExpr ) -> bool :
6234+ def is_type_call (expr : Expression ) -> TypeGuard [ CallExpr ] :
62356235 """Is expr a call to type with one argument?"""
6236- return refers_to_fullname (expr .callee , "builtins.type" ) and len (expr .args ) == 1
6236+ return (
6237+ isinstance (expr , CallExpr )
6238+ and refers_to_fullname (expr .callee , "builtins.type" )
6239+ and len (expr .args ) == 1
6240+ )
62376241
62386242 # exprs that are being passed into type
62396243 exprs_in_type_calls : list [Expression ] = []
@@ -6245,7 +6249,7 @@ def is_type_call(expr: CallExpr) -> bool:
62456249 for index in expr_indices :
62466250 expr = node .operands [index ]
62476251
6248- if isinstance ( expr , CallExpr ) and is_type_call (expr ):
6252+ if is_type_call (expr ):
62496253 exprs_in_type_calls .append (expr .args [0 ])
62506254 else :
62516255 current_type = self .get_isinstance_type (expr )
You can’t perform that action at this time.
0 commit comments