@@ -850,7 +850,7 @@ def _node_guarded_by_same_test(node: nodes.NodeNG, other_if: nodes.If) -> bool:
850
850
def _uncertain_nodes_in_except_blocks (
851
851
found_nodes : list [nodes .NodeNG ],
852
852
node : nodes .NodeNG ,
853
- node_statement : nodes .Statement ,
853
+ node_statement : _base_nodes .Statement ,
854
854
) -> list [nodes .NodeNG ]:
855
855
"""Return any nodes in ``found_nodes`` that should be treated as uncertain
856
856
because they are in an except block.
@@ -1071,7 +1071,7 @@ def _try_in_loop_body(
1071
1071
1072
1072
@staticmethod
1073
1073
def _recursive_search_for_continue_before_break (
1074
- stmt : nodes .Statement , break_stmt : nodes .Break
1074
+ stmt : _base_nodes .Statement , break_stmt : nodes .Break
1075
1075
) -> bool :
1076
1076
"""Return True if any Continue node can be found in descendants of `stmt`
1077
1077
before encountering `break_stmt`, ignoring any nested loops.
@@ -1091,7 +1091,7 @@ def _recursive_search_for_continue_before_break(
1091
1091
1092
1092
@staticmethod
1093
1093
def _uncertain_nodes_in_try_blocks_when_evaluating_except_blocks (
1094
- found_nodes : list [nodes .NodeNG ], node_statement : nodes .Statement
1094
+ found_nodes : list [nodes .NodeNG ], node_statement : _base_nodes .Statement
1095
1095
) -> list [nodes .NodeNG ]:
1096
1096
"""Return any nodes in ``found_nodes`` that should be treated as uncertain.
1097
1097
@@ -1139,7 +1139,7 @@ def _uncertain_nodes_in_try_blocks_when_evaluating_except_blocks(
1139
1139
1140
1140
@staticmethod
1141
1141
def _uncertain_nodes_in_try_blocks_when_evaluating_finally_blocks (
1142
- found_nodes : list [nodes .NodeNG ], node_statement : nodes .Statement
1142
+ found_nodes : list [nodes .NodeNG ], node_statement : _base_nodes .Statement
1143
1143
) -> list [nodes .NodeNG ]:
1144
1144
uncertain_nodes : list [nodes .NodeNG ] = []
1145
1145
(
@@ -2183,8 +2183,8 @@ def _in_lambda_or_comprehension_body(
2183
2183
def _is_variable_violation (
2184
2184
node : nodes .Name ,
2185
2185
defnode : nodes .NodeNG ,
2186
- stmt : nodes .Statement ,
2187
- defstmt : nodes .Statement ,
2186
+ stmt : _base_nodes .Statement ,
2187
+ defstmt : _base_nodes .Statement ,
2188
2188
frame : nodes .LocalsDictNodeNG , # scope of statement of node
2189
2189
defframe : nodes .LocalsDictNodeNG ,
2190
2190
base_scope_type : str ,
@@ -2338,7 +2338,7 @@ def _is_variable_violation(
2338
2338
return maybe_before_assign , annotation_return , use_outer_definition
2339
2339
2340
2340
@staticmethod
2341
- def _maybe_used_and_assigned_at_once (defstmt : nodes .Statement ) -> bool :
2341
+ def _maybe_used_and_assigned_at_once (defstmt : _base_nodes .Statement ) -> bool :
2342
2342
"""Check if `defstmt` has the potential to use and assign a name in the
2343
2343
same statement.
2344
2344
"""
@@ -2380,7 +2380,9 @@ def _is_builtin(self, name: str) -> bool:
2380
2380
return name in self .linter .config .additional_builtins or utils .is_builtin (name )
2381
2381
2382
2382
@staticmethod
2383
- def _is_only_type_assignment (node : nodes .Name , defstmt : nodes .Statement ) -> bool :
2383
+ def _is_only_type_assignment (
2384
+ node : nodes .Name , defstmt : _base_nodes .Statement
2385
+ ) -> bool :
2384
2386
"""Check if variable only gets assigned a type and never a value."""
2385
2387
if not isinstance (defstmt , nodes .AnnAssign ) or defstmt .value :
2386
2388
return False
0 commit comments