] > Re: [Python-projects] pylint failure? (Logilab.org)

Email Re: [Python-projects] pylint failure?

from
to
Alessandro Caproni <acaproni at eso dot org>
subject
Re: [Python-projects] pylint failure?
date
2005/02/09 16:44
On Wednesday 09 February à 16:23, Alessandro Caproni wrote:
> Dear sirs,
> We have recently added pylint to our nightly build and test procedures. 
> The tool is very useful and we are very happy with it.

> pylint checks every module/packages of our software without problems 
> with the exception of the two following situations:

> 1. we have a method that contains the following lines:
>     ...
>   class tClass(eval(enumName, tGlobals, tLocals), Penum):
>      pass
>   ...

> 2. In the second case the tool fails checking the following constructor:
>   def __init__(self, *args):
>     _swig_setattr(self, EpochHelper, 'this', 
> _acstimeSWIG.new_EpochHelper(*args))
>     _swig_setattr(self, EpochHelper, 'thisown', 1)

> The failure is the same in both cases:
> Traceback (most recent call last):
[snip traceback]
> AttributeError: Getattr instance has no attribute 'get_method'

> We're usign pylint v0.6.1 with the common library 0.9.1 and python2.2.2.
> I have also tryed pylint 0.6.0 with the common library 0.9.0 and the 
> situation is the same.

> Do you have any suggestion?

Hum, you've actually hit a bug in pylint. I'll try to fix this to avoid
pylint to choke, but I guess I won't be able to do much more, such as
resolving your class'parent, because of the "eval" call. This is the 
first time I see this kind of construct to define a class, and I find 
it, well... at least unreadable ;)

The best suggestion I have is to avoid using eval in the parents list
of your class. Maybe can you explain us what are you trying to acheive
so we can help you to get something more clean and clear.

-- 
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
has reply