What does this PyChecker warning mean?

Steven W. Orr steveo at syslang.net
Tue Jun 1 10:27:13 EDT 2010


On 6/1/2010 7:53 AM, Xavier Ho wrote:
> On 1 June 2010 21:48, Leo Breebaart <leo at lspace.org
> <mailto:leo at lspace.org>> 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)
>
>
> Out of curiosity, why are you defining two classes inside a function?
>
> -Xav
>

In terms of constructing a minimal example, Foo might be fodder for a closure 
that either returns A or B. Just s stab in the dark...


-- 
Time flies like the wind. Fruit flies like a banana. Stranger things have  .0.
happened but none stranger than this. Does your driver's license say Organ ..0
Donor?Black holes are where God divided by zero. Listen to me! We are all- 000
individuals! What if this weren't a hypothetical question?
steveo at syslang.net



More information about the Python-list mailing list