[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 12:58:58 CET 2006
On Tuesday 21 November à 11:46, Alexandre Fayolle wrote:
> On Mon, Nov 20, 2006 at 11:18:57AM -0600, skip at pobox.com wrote:
> >
> > >> I found a email to this list in august from Skip Montano reporting
> > >> the problem. Give that pylint is unusable with this bug in place I'm
> > >> surprised that the lastest released kit contains this show stopper
> > >> bug.
> >
> > Alexandre> If you read the recent archives you will see that this has
> > Alexandre> been discussed, and it looks like it is a pygtk issue.
> >
> > My problem seems to be related to our use of the pygtk module to extend
> > sys.path to refer to the relevant version of gtk. For example, our code
> > contains:
> >
> > import pygtk
> > pygtk.require("2.6")
> >
> > import gobject
> >
> > The pygtk.require() call adds our gtk 2.6 installation directory to
> > sys.path.
> <snip>
> > module and rummage around in it. There is no gobject module in the default
> > sys.path in our environment. I'm not sure how pylint could improve in this
> > regard without actually importing the module/script.
>
> A way of achieving this could be adding a hook that would be run when
> pylint starts, in order to ease sys.path manipulation. Usage example:
>
> pylint --init-hook='import pygtk; pygtk.require("2.6")' [other options] mymodule
>
> We could also consider having a few shortcuts for some common cases,
> such as --with-pygtk=2.6, if there is demand for this.
>
> Sylvain, what is your opinion on this?
Hum, that sounds good to me. Idealy I would like pylint/astng to
understand dynamically sys.path manipulation but as this is quite hard
and I'm not even sure feasible in most cases, a solution like the one
you propose would probably be the easiest and cleanest way to fix this
asap. Maybe others on the list have an opinion or idea ?
--
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