What does this PyChecker warning mean?

Terry Reedy tjreedy at udel.edu
Tue Jun 1 11:38:17 EDT 2010


On 6/1/2010 8:23 AM, Peter Otten wrote:
> Leo Breebaart wrote:
>
>>
>> When fed the following code:
>>
>>   def Foo():
>>
>>      class A(object):
>>          def __init__(self):
>>              pass
>>
>>      class B(object):
>>          def __init__(self):
>>              pass
>>
>> PyChecker 0.8.18 warns:
>>
>>    foo.py:9: Redefining attribute (__init__) original line (5)
>>
>> I do not understand what is meant by this warning. In fact, it
>> simply seems wrong -- but I have learned not to jump to that
>> conclusion too quickly, so I was hoping someone here could
>> perhaps enlighten me...
>
> You are right, that's a false positive. pychecker seems to confuse the
> namespaces.

Consider sending this example back to the pychecker author.
The program does not seem to be interpreting the nested class statements 
properly.






More information about the Python-list mailing list