I noticed recently that pylint has begun warning about use of parens on
print statements in Python 2.x code.

This seems reasonable on the face of it, except it deters writing code that
runs on 2.x and 3.x, unmodified.

The error looks like:
C:  5, 0: Unnecessary parens after 'print' keyword (superfluous-parens)

The offending line looks like:
print('hello')

To Python 2.x, that is printing the result of a parenthesized expression.
To Python 3.x, it is of course a print function.

I understand that doing something like:
print('number:', 1)
...would be bad in a dual-codebase script, but having a single argument
works, and indeed is often a good idea for portability.

Thoughts?

-- 
Dan Stromberg
_______________________________________________
Python-Projects mailing list
Python-Projects@lists.logilab.org
http://lists.logilab.org/mailman/listinfo/python-projects

Reply via email to