C0325

Message

Unnecessary parens after %r keyword

Description

Used when the expression after one of the following keywords is surrounded by parenthesis: assert, del, elif, except, for, if, in, not, raise, return, while, yield. In addition, for Python 2.x: print.

This message belongs to the format checker.

Explanation

Parenthesis around such expressions were not necessary in Python 2.x and were suggested to not be used, for simplicity. Python is not C or Java.

In light of Python 2 deprication this is sometimes not wanted even in Python 2 code as it's already possible to write Python 3 syntax.
See this discussion on github: https://github.com/PyCQA/pylint/issues/20

This one can be turned of with the argument:

--ignore-superfluous-parens

Add a New Comment
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License