diff options
author | Claudiu Popa <cpopa@cloudbasesolutions.com> | 2015-02-21 21:06:06 +0200 |
---|---|---|
committer | Claudiu Popa <cpopa@cloudbasesolutions.com> | 2015-02-21 21:06:06 +0200 |
commit | cbc81d3cc95b61206669c0a1905ddb2345fc3828 (patch) | |
tree | 4e8db39e368cc5a41246d47f767abbba1ba0d376 | |
parent | 8fee3b35e6ec67c9d873e994e285ff7d02e3b30e (diff) | |
download | pylint-cbc81d3cc95b61206669c0a1905ddb2345fc3828.tar.gz |
Remove visit_discard for map-builtin-not-iterating, since it is already caught by visit_callfunc.
-rw-r--r-- | pylint/checkers/python3.py | 9 | ||||
-rw-r--r-- | pylint/test/unittest_checker_python3.py | 10 |
2 files changed, 0 insertions, 19 deletions
diff --git a/pylint/checkers/python3.py b/pylint/checkers/python3.py index bb072d1..8248e72 100644 --- a/pylint/checkers/python3.py +++ b/pylint/checkers/python3.py @@ -372,15 +372,6 @@ class Python3Checker(checkers.BaseChecker): if isinstance(arg, astroid.Tuple): self.add_message('parameter-unpacking', node=arg) - @utils.check_messages('map-builtin-not-iterating') - def visit_discard(self, node): - if (isinstance(node.value, astroid.CallFunc) and - isinstance(node.value.func, astroid.Name) and - node.value.func.name == 'map'): - module = node.value.func.lookup('map')[0] - if _is_builtin(module): - self.add_message('map-builtin-not-iterating', node=node) - def visit_name(self, node): """Detect when a "bad" built-in is referenced.""" found_node = node.lookup(node.name)[0] diff --git a/pylint/test/unittest_checker_python3.py b/pylint/test/unittest_checker_python3.py index b07798d..e666f75 100644 --- a/pylint/test/unittest_checker_python3.py +++ b/pylint/test/unittest_checker_python3.py @@ -309,16 +309,6 @@ class Python3CheckerTest(testutils.CheckerTestCase): with self.assertAddsMessages(message): self.checker.visit_callfunc(node) - @python2_only - def test_implicit_map_evaluation(self): - node = test_utils.extract_node('map(str, [1, 2, 3])') - discard = node.parent - message = testutils.Message('map-builtin-not-iterating', node=discard) - with self.assertAddsMessages(message): - # Use node.parent because extract_node returns the value - # of a discard node, not the discard itself. - self.checker.visit_discard(discard) - def test_not_next_method(self): arg_node = test_utils.extract_node('x.next(x) #@') stararg_node = test_utils.extract_node('x.next(*x) #@') |