[Python-projects] Possible PyLint bug with imported "new-style" classes?

Sylvain Thénault sylvain.thenault at logilab.fr
Thu Feb 7 10:06:29 CET 2008


On Wed, Feb 06, 2008 at 03:20:00PM -0500, Hiltz-Laforge, Jason wrote:
> Bonjour :-)

Bonjour,
 
> Thanks for all the hard work with PyLint. It's an excellent tool.

Thanks :)
 
> I've run into what may be a false positive for the E1101 (Instance of x has no
> y data member) and E1002 (Use super on an old style class) messages.
> 
> Here's a trivial example:
> 
> class Base(object):
> 
>         def __init__(self):
>                 super(Base, self).__init__()
>                
> class Derived(Base):
> 
>         def __init__(self):
>                 super(Derived, self).__init__()
> 
> Now, this lints with no issues if both classes are in the same python file.
> 
> If I split it up into two files (say base.py and derived.py), and use "from
> base import Base" in the latter, PyLint reports an E1101 and E1002 error. This
> is using pylint 0.13.2, astng 0.17.1 and logilab-common 0.22.2. Have I goofed
> this up somehow or is it simply a bug?

this is much probably a python path bug. If you type "python" in the
same place where you type "pylint", does "import base" works ?

-- 
Sylvain Thénault                               LOGILAB, Paris (France)
Formations Python, Zope, Plone, Debian:  http://www.logilab.fr/formations
Développement logiciel sur mesure:       http://www.logilab.fr/services
Python et calcul scientifique:           http://www.logilab.fr/science



More information about the Python-Projects mailing list