I have a file p.py which has a single line:
print('hello')
I run pylint (2.6.0) with:
pylint p.py --enable=E
all I get is:
************* Module p
p.py:1:0: C0304: Final newline missing (missing-final-newline)
p.py:1:0: C0114: Missing module docstring (missing-module-docstring)
----------------------------------------------------------------------
Your code has been rated at -10.00/10 (previous run: -10.00/10, +0.00)
How do I get pylint to throw E1601?
To trigger this error you'd need to be running Python 2.x and use a print statement instead of the print function
Print statements were the only option in early releases of Python 2.x. It was only with the decision to replace them with print functions in Python 3, that print functions were added to Python 2.6.
# Print statement, only works in Python 2.x
print 'hello'
# Print function, Python >= 2.6
print('hello')
Pylint won't emit E1601 when running Python >= 3.0. In Python 3 using a print statement isn't a stylistic error it's a syntax error. My best guess why E1601 exists is to encourage Python 2 developers to use Python 3 features when possible so that their code is more portable.