Skip to content

Commit

Permalink
Add typing and remove TODO
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielNoord committed Nov 16, 2021
1 parent 99cd3a9 commit 810d649
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions pylint/checkers/variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 810d649

Please sign in to comment.