On 21 mars 11:33, Alex Margarit wrote: > Hey, Hi,
sorry, I've been missing some time last week to review pylint patches. Hopefuly this week will be better :) > I was wondering if anyone had the time to take a look at the patch I > sent for Pylint ticket #8776. Do you think my solution is appropriate? > > http://www.logilab.org/ticket/8776 > > I reattached the diff. Thanks, > diff -r f5f084e5267a ChangeLog > diff -r f5f084e5267a lint.py > --- a/lint.py Thu Mar 04 12:12:32 2010 +0100 > +++ b/lint.py Tue Mar 16 01:35:36 2010 -0400 > @@ -466,7 +466,10 @@ > self._module_msgs_state[msgid][line] = state > except KeyError: > self._module_msgs_state[msgid] = {line: > state} > - del lines[lineno] > + # the arguments list is a special case, since it is part > of > + # the same logical code line as the function definition > + if str(node) != 'arguments()': > + del lines[lineno] I don't think this solution is appropriate. First, testing str(node) is definitly a bad idea. Using isinstance(node, ...) would be e bit better but still sound bad. Actually, the special casing on arguments at this point of the code seems to be the flaw. IMO the root of the pb lies in values returned by block_range() for function and / or arguments nodes. -- Sylvain Thénault LOGILAB, Paris (France) Formations Python, Debian, Méth. Agiles: http://www.logilab.fr/formations Développement logiciel sur mesure: http://www.logilab.fr/services CubicWeb, the semantic web framework: http://www.cubicweb.org _______________________________________________ Python-Projects mailing list Python-Projects@lists.logilab.org http://lists.logilab.org/mailman/listinfo/python-projects