[Python-projects] Bug in pylint ? Looks like pylint 0.14.0 can't detect mismatch in function arguments!
Pierre Rouleau
prouleau001 at sympatico.ca
Thu Jul 10 02:22:19 CEST 2008
On 9-Jul-08, at 7:40 AM, Sylvain Thénault wrote:
> On Wed, Jul 09, 2008 at 07:34:03AM -0400, Pierre Rouleau wrote:
>> Sylvain Thénault wrote:
>>> On Sat, Jul 05, 2008 at 05:21:20PM -0400, Pierre Rouleau wrote:
>>>
>>>> Hi. I think I'v found a bug in Pylint 0.14.0
>>>>
>>>
>>> Hi Pierre!
>>>
>> Bonjour!
>>>
>>>> In the test file included below, Pylint 0.14.0 fails to report
>>>> calls
>>>> with invalid number of arguments! I tried it on a directory
>>>> with no
>>>> rcfile just to be sure. That's got to be a new bug, I'm sure I'v
>>>> seen report of invalid number of arguments before with Pylint.
>>>>
>>>> At first I ran it with logilab common 0.29.1. Then I noticed that
>>>> common 0.33.0 was available; I downloaded it and tried the test
>>>> gain:
>>>> no change.
>>>>
>>>> This is got to be a *major* bug. Am I missing something here? I
>>>> am a
>>>> little tired, having worked several nights to complete
>>>> something at
>>>> work. But I was sure pylint was able to detect these mismatch
>>>> before... Somehow, now, pylint 0.14.0 accepts invalid calls...
>>>>
>>>
>>> huum, I'm afraid that this has never been implemented in pylint
>>> (yet).
>>> The only thing that has been done is checking of argument
>>> consistency
>>> when defining/overriding *methods*. Function/methods calls aren't
>>> checked, though this could be done quite easily now that we have a
>>> better inference mecanism. The problem is that, as you may have
>>> noticed, i'm really missing some time to work on pylint those
>>> days. For
>>> instance I've started a few months ago some work on astng to have it
>>> working using
>>> either the compiler module or the new _ast of python 2.5 but I've
>>> not
>>> yet found the time to finalize it. Hope I'll get some time back in a
>>> near future for the pending stuff I've in mind for pylint. I'll
>>> include
>>> function calls checking in this, I've created a ticket for this so I
>>> wont forget: http://www.logilab.org/ticket/5561.
>>>
>>> Thank you for the already written test file ;)
>>> Cheers,
>>>
>> Ok. Thanks. I never realized there was a difference in treatment of
>> methods and functions in pylint. I think it would indeed be a good
>> thing to be able to detect such discrepancies.
>
> I didn't meant that methods calls where checked while functions calls
> weren't. I juste meant that pylint is checking arguments when a method
> overrides another method, which doesn't make sense on functions.
>
Understood. Hope you get some free time to work on pylint.
--
Pierre Rouleau
More information about the Python-Projects
mailing list