diff --git a/pylint/checkers/variables.py b/pylint/checkers/variables.py index ba3b324e8c8..639d84ff1c1 100644 --- a/pylint/checkers/variables.py +++ b/pylint/checkers/variables.py @@ -1392,8 +1392,8 @@ def _in_lambda_or_comprehension_body( def _is_variable_violation( node: nodes.Name, defnode, - stmt, - defstmt, + stmt: nodes.Statement, + defstmt: nodes.Statement, frame, # scope of statement of node defframe, base_scope_type, @@ -1580,12 +1580,8 @@ def _is_variable_violation( return maybee0601, annotation_return, use_outer_definition - # pylint: disable-next=fixme - # TODO: The typing of `NodeNG.statement()` in astroid is non-specific - # After this has been updated the typing of `defstmt` should reflect this - # See: https://github.com/PyCQA/astroid/pull/1217 @staticmethod - def _is_only_type_assignment(node: nodes.Name, defstmt: nodes.NodeNG) -> bool: + def _is_only_type_assignment(node: nodes.Name, defstmt: nodes.Statement) -> bool: """Check if variable only gets assigned a type and never a value""" if not isinstance(defstmt, nodes.AnnAssign) or defstmt.value: return False