[Python-projects] pylint usage patterns (Re: pylint: unused local variables and their context)
Alexandre Fayolle
alexandre.fayolle at logilab.fr
Sat Dec 2 09:54:51 CET 2006
On Fri, Dec 01, 2006 at 12:02:16PM -0600, skip at pobox.com wrote:
>
> Daniel> It would be nice if pylint could *not* flag these as unused
> Daniel> variables: loop counters, variables assigned as parts of a tuple
> Daniel> assignment
>
> If you preface the unused variables with an underscore, it shuts pylint up.
> I think there's also a regular expression you can define which affects which
> unused variables pylint won't complain about.
>
> Daniel> Does anyone have any suggestions for fixing this properly inside
> Daniel> pylint? (I know that we could simply name those variables in a
> Daniel> way that pylint ignores them, but I'd much prefer a transparent
> Daniel> solution)
>
> I find it worthwhile to be explicit. How otherwise is pylint to guess which
> of your unused variables to complain about and which not?
I totally agree with skip.
Just for the record, what pylint says is not to be taken as gospel.
In this very case there are many other examples of perfectly legal unused
variables, in addition to the ones mentionned above. While getting as
few false positives for errors as possible is a goal for us -- and
python makes it hard enough, it is not the case for warnings.
My usage pattern for pylint is to generally run pylint -e quite often to
get stupid errors flagged before launching an application (or before
comitting). I generally run pyling whith the whole bells and whistles
activated some time before a release, when I want to cleanup the code.
And when I do that I simply ignore tons all the false warnings (and I
can do that without being driven mad by this dumb program which is not
smart enough to understand the dynamicity of Python because I only run
it once or twice a week in this mode)
I'm curious. How do you pylint users accross the world use this tool?
--
Alexandre Fayolle LOGILAB, Paris (France)
Formations Python, Zope, Plone, Debian: http://www.logilab.fr/formations
Développement logiciel sur mesure: http://www.logilab.fr/services
Informatique scientifique: http://www.logilab.fr/science
Reprise et maintenance de sites CPS: http://www.migration-cms.com/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 481 bytes
Desc: Digital signature
Url : http://lists.logilab.org/pipermail/python-projects/attachments/20061202/8e10229c/attachment.pgp
More information about the Python-Projects
mailing list