On 02 mars 01:41, Maarten ter Huurne wrote:
> Hi,

Hi Maarten
 
> 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.

reviewed and pushed, thanks!

-- 
Sylvain Thénault                               LOGILAB, Paris (France)
Formations Python, Debian, Méth. Agiles: http://www.logilab.fr/formations
Développement logiciel sur mesure:       http://www.logilab.fr/services
CubicWeb, the semantic web framework:    http://www.cubicweb.org

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

Reply via email to