diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | pylint/checkers/base.py | 8 | ||||
-rw-r--r-- | pylint/test/functional/bad_reversed_sequence.py | 2 | ||||
-rw-r--r-- | pylint/test/functional/bad_reversed_sequence.txt | 1 |
4 files changed, 10 insertions, 8 deletions
@@ -253,6 +253,13 @@ ChangeLog for Pylint * missing-module-attribute was removed and the corresponding CLI option, required-attributes, which is slated for removal in Pylint 1.6. + + * missing-reversed-argument was removed. + + The reason behind this is that this kind of errors should be + detected by the type checker for *all* the builtins and not + as a special case for the reversed builtin. This will happen + shortly in the future. diff --git a/pylint/checkers/base.py b/pylint/checkers/base.py index 11f0b1d..017144f 100644 --- a/pylint/checkers/base.py +++ b/pylint/checkers/base.py @@ -604,9 +604,6 @@ functions, methods 'Emitted when a conditional statement (If or ternary if) ' 'uses a constant value for its test. This might not be what ' 'the user intended to do.'), - 'E0109': ('Missing argument to reversed()', - 'missing-reversed-argument', - 'Used when reversed() builtin didn\'t receive an argument.'), 'E0111': ('The first reversed() argument is not a sequence', 'bad-reversed-sequence', 'Used when the first argument to reversed() builtin ' @@ -882,8 +879,7 @@ functions, methods self.add_message('exec-used', node=node) @check_messages('bad-builtin', 'eval-used', - 'exec-used', 'missing-reversed-argument', - 'bad-reversed-sequence') + 'exec-used', 'bad-reversed-sequence') def visit_callfunc(self, node): """visit a CallFunc node -> check if this is not a blacklisted builtin call and check for * or ** use @@ -963,7 +959,7 @@ functions, methods try: argument = helpers.safe_infer(get_argument_from_call(node, position=0)) except NoSuchArgumentError: - self.add_message('missing-reversed-argument', node=node) + pass else: if argument is astroid.YES: return diff --git a/pylint/test/functional/bad_reversed_sequence.py b/pylint/test/functional/bad_reversed_sequence.py index 852510f..6deb795 100644 --- a/pylint/test/functional/bad_reversed_sequence.py +++ b/pylint/test/functional/bad_reversed_sequence.py @@ -39,7 +39,7 @@ def uninferable(seq): def test(path): """ test function """ - seq = reversed() # [missing-reversed-argument] + seq = reversed() # No argument given seq = reversed(None) # [bad-reversed-sequence] seq = reversed([1, 2, 3]) seq = reversed((1, 2, 3)) diff --git a/pylint/test/functional/bad_reversed_sequence.txt b/pylint/test/functional/bad_reversed_sequence.txt index ccdec39..dd0c6f9 100644 --- a/pylint/test/functional/bad_reversed_sequence.txt +++ b/pylint/test/functional/bad_reversed_sequence.txt @@ -1,4 +1,3 @@ -missing-reversed-argument:42:test:Missing argument to reversed()
bad-reversed-sequence:43:test:The first reversed() argument is not a sequence
bad-reversed-sequence:46:test:The first reversed() argument is not a sequence
bad-reversed-sequence:47:test:The first reversed() argument is not a sequence
|