[Python-projects] __init__ method from a non direct base class <logilab.astng.Yes object at 0xb7f8392c> is called
Sylvain Thénault
sylvain.thenault at logilab.fr
Tue Nov 21 13:20:09 CET 2006
On Tuesday 21 November à 11:07, Barry Scott wrote:
> Alexandre Fayolle wrote:
> > On Mon, Nov 20, 2006 at 04:51:44PM +0000, Barry Scott wrote:
> > <snip>
> >
> >> My code does not use gtk. It is pure python (except for the extensions
> >> that ship with python 2.4 itself).
> >>
> >
> > <snip>
> >
> >
> >> The code I'm running pylint against is very big it may take me a while
> >> to get a small example that duplicate the error.
> >>
> >
> > Could you tell us what the inheritance hierarchy of ActionItemEdit is?
> >
> I get around 200 errors out of the first module that I run pylint on. I
> cannot release
> this source for you to test against. I will have to build a smaller example
> that breaks otherwise we will have nothing concrete to work with.
>
> My first attempt at a small example did not have the problem with this
> class.
> However when I forgot to copy a __init__.py I did see the message:
>
> __init__ method from a non direct base class <logilab.astng.Yes
> object at 0xb7f8392c> is called
>
> So a missing __init__.py is another way to get this message.
>
> Am I right in guessing that this message means pylint/ast failed to find
> information? Is it
> a place holder in the code?
you're right, and the easiest way to get ride of W0233 false positive is
to skip YES object where this message is issued, as done by the patch
below. Getting warning for inference problem is harder since this
problem is tied to astng which shouldn't contain pylint specific code.
I plan to use the logging module at some point to allow astng > pylint
communication, but this is really not a priority for me at least, so...
diff -r a6d5c4daf255 checkers/classes.py
--- a/checkers/classes.py Wed Nov 15 19:43:01 2006 +0100
+++ b/checkers/classes.py Mon Nov 20 16:47:00 2006 +0100
@@ -442,6 +440,8 @@ instance attributes.'}
return
try:
klass = expr.expr.infer().next()
+ if klass is astng.YES:
+ continue
try:
del to_call[klass]
except KeyError:
--
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