diff options
author | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2021-06-30 21:57:04 +0200 |
---|---|---|
committer | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2021-06-30 23:13:20 +0200 |
commit | d23fa78be60cdef41a45ab5070a520387fd74471 (patch) | |
tree | 4c5d8be9b8a52baba084fd7fd936dc4d0a5e9a30 | |
parent | f10fb70e7b0752d0df938e50cc6c0b7f3b704944 (diff) | |
download | pylint-git-d23fa78be60cdef41a45ab5070a520387fd74471.tar.gz |
Add typing in '_check_unused_private_members''s for loops
-rw-r--r-- | pylint/checkers/classes.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/pylint/checkers/classes.py b/pylint/checkers/classes.py index 4d86a6bbb..de945b177 100644 --- a/pylint/checkers/classes.py +++ b/pylint/checkers/classes.py @@ -46,7 +46,7 @@ """ import collections from itertools import chain, zip_longest -from typing import List, Pattern +from typing import List, Pattern, cast import astroid @@ -904,10 +904,12 @@ a metaclass class method.", def _check_unused_private_members(self, node: astroid.ClassDef) -> None: # Check for unused private functions for function_def in node.nodes_of_class(astroid.FunctionDef): + function_def = cast(astroid.FunctionDef, function_def) found = False if not is_attr_private(function_def.name): continue for attribute in node.nodes_of_class(astroid.Attribute): + attribute = cast(astroid.Attribute, attribute) if ( attribute.attrname == function_def.name and attribute.scope() != function_def # We ignore recursive calls |