[Python-projects] pylint: unused local variables and their context

skip at pobox.com skip at pobox.com
Fri Dec 1 19:02:16 CET 2006


    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?

Skip


More information about the Python-Projects mailing list