[Python-projects] pylint bug: No line number for Lambda
Jeremy Hylton
jhylton at google.com
Tue Nov 27 14:35:09 CET 2007
On 11/19/07, Jeremy Hylton <jhylton at google.com> wrote:
> This is a bug report for pylint version 0.13.2. We've got a custom
> checker that adds a message for lambda nodes that are too long. In
> some cases (perhaps all?) the node passed to add_message() has
> fromlineno set to None. In those cases, the line number for the
> warning message is 1. I see there's some commented out code in
> add_message() that seems to concern itself with the same problem. I
> have that changing add_message to consider lineno as well seemed to
> fix our problem.
>
> def add_message(self, msg_id, line=None, node=None, args=None):
> """add the message corresponding to the given id.
>
> If provided, msg is expanded using args
>
> astng checkers should provide the node argument, raw checkers should
> provide the line argument.
> """
> if line is None and node is not None:
> line = node.fromlineno or node.lineno
>
> Is there a better way to fix this problem?
>
> Jeremy
Just checking: Is this the right place to report pylint bugs?
Jeremy
More information about the Python-Projects
mailing list