I sometimes have code like this:
from somewhere import method
from somewhere import CONSTANT
where CONSTANT defines a class attribute, anbd method
is a method that I would like to call like any other
methor (self.spam(), or self.blah()).
This works nicely and is a compact coding style, however
frosted complains about unused imports.
Should I fix my coding habits, or should frosted by fixed?
On 06/02/2014 02:13, Dan Stromberg wrote:
> 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:
> 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.
> Dan Stromberg
> Python-Projects mailing list
There is a __future__ import to enable print_function in python 2.
I'm not sure if Pylint knows about it, though...
I'm getting mixed results from pylint when it inspects the result of
simplejson.loads versus json.loads. I've documented some of my findings in
the stackoverflow question at
I'm still not very clear as to why one implementation gets past pylint's
checks while the other doesn't. Also out of curiosity - what would be the
correct approach for dealing with a function that returns one of many