diff options
| author | Claudiu Popa <pcmanticore@gmail.com> | 2019-10-30 08:47:35 +0100 |
|---|---|---|
| committer | Claudiu Popa <pcmanticore@gmail.com> | 2019-10-30 08:47:35 +0100 |
| commit | a25d8df2ac12f040baf73c4ff40fa6b34dc39f97 (patch) | |
| tree | d5414b5576a6f61bb8528c75754b0055955c3e30 /pylint/checkers/python3.py | |
| parent | 618af398c9b52a934cdd45fc407007e59c65bcad (diff) | |
| download | pylint-git-a25d8df2ac12f040baf73c4ff40fa6b34dc39f97.tar.gz | |
Move the set construction for _infer_if_relevant_attr at the class level
Diffstat (limited to 'pylint/checkers/python3.py')
| -rw-r--r-- | pylint/checkers/python3.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/pylint/checkers/python3.py b/pylint/checkers/python3.py index 6fe992e0e..d4b6ab59a 100644 --- a/pylint/checkers/python3.py +++ b/pylint/checkers/python3.py @@ -887,6 +887,10 @@ class Python3Checker(checkers.BaseChecker): ) ) + _relevant_call_attrs = ( + DICT_METHODS | _deprecated_attrs | {"encode", "decode", "translate"} + ) + _python_2_tests = frozenset( [ astroid.extract_node(x).repr_tree() @@ -1149,10 +1153,7 @@ class Python3Checker(checkers.BaseChecker): try: for inferred_receiver in _infer_if_relevant_attr( - node.func, - DICT_METHODS - | self._deprecated_attrs - | {"encode", "decode", "translate"}, + node.func, self._relevant_call_attrs ): if inferred_receiver is astroid.Uninferable: continue |
