diff options
author | Anthony Sottile <asottile@umich.edu> | 2018-05-22 22:51:37 -0700 |
---|---|---|
committer | Claudiu Popa <pcmanticore@gmail.com> | 2018-06-06 17:43:25 -0700 |
commit | f323a50f68adcd448484467e071cb3ba0492b741 (patch) | |
tree | c4a097e459d297bda33643cf7be904d68201fa21 | |
parent | b33128e0b8610af2a709226185921299d5aa3897 (diff) | |
download | pylint-git-f323a50f68adcd448484467e071cb3ba0492b741.tar.gz |
min() and max() accept iterators (#2138)
-rw-r--r-- | pylint/checkers/python3.py | 3 | ||||
-rw-r--r-- | pylint/test/unittest_checker_python3.py | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/pylint/checkers/python3.py b/pylint/checkers/python3.py index 704f94b62..2e24af040 100644 --- a/pylint/checkers/python3.py +++ b/pylint/checkers/python3.py @@ -78,7 +78,8 @@ def _is_builtin(node): _ACCEPTS_ITERATOR = {'iter', 'list', 'tuple', 'sorted', 'set', 'sum', 'any', - 'all', 'enumerate', 'dict', 'filter', 'reversed'} + 'all', 'enumerate', 'dict', 'filter', 'reversed', + 'max', 'min'} DICT_METHODS = {'items', 'keys', 'values'} diff --git a/pylint/test/unittest_checker_python3.py b/pylint/test/unittest_checker_python3.py index ab3de20af..a5166ff0f 100644 --- a/pylint/test/unittest_checker_python3.py +++ b/pylint/test/unittest_checker_python3.py @@ -205,6 +205,8 @@ class TestPython3Checker(testutils.CheckerTestCase): '[x for x in {}()]', 'iter({}())', 'a, b = {}()', + 'max({}())', + 'min({}())', ] non_iterating_code = [ 'x = __({}())', |