Hi,

When I run pylint on this program:
===
class Base(object):
        pass

class Slice(Base):

        def __init__(self, value):
                if value is None:
                        Base.__init__(self)
                else:
                        Base.__init__(self)
===

It reports:
===
W0233: 10:Slice.__init__: __init__ method from a non direct base class 
'Base' is called
===

The problem is in checkers/classes.py: every time a superclass constructor 
is called, it is removed from the set of constructors that must still be 
called. However, this same set is used to check which constructors are 
allowed to be called. As a result, the second time a call the same 
superclass constructor is encountered, pylint thinks it is not valid.

I added a test case and modified pylint to no longer issue the false 
positive. The patch is in the attached Mercurial bundle. Please review it.

Bye,
                Maarten

Attachment: w0233-calltwice.hg
Description: Binary data

_______________________________________________
Python-Projects mailing list
Python-Projects@lists.logilab.org
http://lists.logilab.org/mailman/listinfo/python-projects

Reply via email to