#10 Spurious __init__ not called warning

closed-works-for-me
nobody
None
5
2002-01-08
2002-01-07
Andrew Bennetts
No

class Base:
pass

class Derived(Base):
def __init__(self):
self.x = 1

In this case, PyChecker will warn that Base's "__init__
() not called", even though Base has no __init__, and
to attempt to call it would produce an error.

Discussion

  • Neal Norwitz
    Neal Norwitz
    2002-01-07

    Logged In: YES
    user_id=33168

    I don't have a problem with this code. I tested
    on 1.5.2, 2.1, and 2.2. There are some known problems,
    see bugs: #498256 & #455534.

    Often these problems occur when doing a from/import .
    Is this the same as one of the bug reports?

     
    • status: open --> closed-works-for-me
     
  • Logged In: YES
    user_id=50945

    Sorry, my bad. I didn't bother to test this test case...

    What I was actually seeing was bug #455534 -- I should have
    read the bug reports first.

    Apologies for the noise. I'm closing this request, and
    marking it as "Works for me".