(My apologies for using gmane.  Needed to get this out and my laptop
is unavailable...)

I just found a long-standing bug in a function (at least three years
old) which goes like this:

    def func(..., msg, ...):
        ...
        try:
            blah
        except SomeException, msg:
            blah blah blah msg

Pylint doesn't catch that I have shadowed the argument msg.  Since
that shadowing happened in an except clause it went unexecuted (and
thus undetected) for a long time.

If, however, I shadow a global variable pylint does complain:

    import msg

    def func(...):
        ...
        try:
            blah
        except SomeException, msg:
            blah blah blah msg

It seems to me that formal function parameters are about as important
as globals.  Any chance of coaxing pylint into warning about shadowing
parameters?

Thx,

Skip Montanaro
[email protected]


_______________________________________________
Python-Projects mailing list
[email protected]
http://lists.logilab.org/mailman/listinfo/python-projects

Reply via email to