Email [Python-projects] Re: Problem with __init__ and inheritance

from
subject
[Python-projects] Re: Problem with __init__ and inheritance
date
2005/02/11 15:56
On Friday 11 February à 15:10, Kring Gerhard wrote:
> Hello Sylvain,

Hi

> with pyLint 0.6.0 there seem to be still some problems with inheritance:

Two side notes :
- pylint 0.6.1 and common 0.9.1 are available (mostly windows related 
  fixes though), but I've not made any public annoucement yet
- please keep pylint's related discussion on the
  python-projects@logilab.org mailing list

> a.) variable initializations done in explicitly called __init__() methods from inherited classes are not considered and we get Errors E0203 for these.

> E0203: 37:SeeTelnet.readUntilArray: Access to member 'cookedq' before its definition line 42
> E0203: 41:SeeTelnet.readUntilArray: Access to member 'cookedq' before its definition line 42

> See attached telnetexample.py
>  <<telnetexample.py>> 

ok, I've fixed this in the cvs.

> b.) We get very often R0903: Not enough public methods (1/2) in cases, where we inherit from a class with 'many' methods, but just one method is being overriden.
> For me this no bad code.
 
for me neither, but I can't reproduce it. I guess you've got this
problem with a class where pylint has not been able to get the
class'parent. For instance, in the sample file you sent me, I get 

R0904:  9:SeeTelnet: Too many public methods (25/20)

on a class with a single public method because it counts methods from
the telentlib.Telnet ancestor class. (Well, I guess we should probably
also avoid this warning, but that's another problem ;)

regards
-- 
Sylvain Thénault                               LOGILAB, Paris (France).

http://www.logilab.com   http://www.logilab.fr  http://www.logilab.org

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


is a reply to