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 9db3e0f
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 7 deletions.
1 change: 1 addition & 0 deletions .pylint_primer_tests/django/django
Submodule django added at 12fe32
1 change: 1 addition & 0 deletions .pylint_primer_tests/getsentry/sentry
Submodule sentry added at a9a3b0
1 change: 1 addition & 0 deletions .pylint_primer_tests/home-assistant/core
Submodule core added at 4f0163
1 change: 1 addition & 0 deletions .pylint_primer_tests/keras-team/keras
Submodule keras added at 94373f
1 change: 1 addition & 0 deletions .pylint_primer_tests/pallets/flask
Submodule flask added at ea66c6
1 change: 1 addition & 0 deletions .pylint_primer_tests/pandas-dev/pandas
Submodule pandas added at 700be6
1 change: 1 addition & 0 deletions .pylint_primer_tests/psf/black
Submodule black added at 0d1b95
1 change: 1 addition & 0 deletions .pylint_primer_tests/pygame/pygame
Submodule pygame added at 6d24cd
1 change: 1 addition & 0 deletions .pylint_primer_tests/scikit-learn/scikit-learn
Submodule scikit-learn added at 6077d5
1 change: 1 addition & 0 deletions .pylint_primer_tests/vimeo/graph-explorer
Submodule graph-explorer added at bc557a
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 9db3e0f

Please sign in to comment.