[code-quality] pylint can't deduce the type of an object

Paul Smith paul at mad-scientist.net
Fri Nov 28 22:18:23 CET 2014


On Fri, 2014-11-28 at 23:09 +0200, Claudiu Popa wrote:
> On Fri, Nov 28, 2014 at 10:57 PM, Paul Smith <paul at mad-scientist.net> wrote:
> > Hi all; as mentioned in a previous post, I am looking into updating my
> > curring pylint (1.0.1) to newer pylint 1.4.0.
> >
> > I've got one significant problem left and I'm not sure how to resolve
> > it: in the new pylint I'm seeing a number of errors like this:
> >
> >   mymod.py:227: [E1101(no-member), MyMod.__str__] Instance of 'int' has no 'get_val' member
> 
> Could you give me a small sample to reproduce this problem?
> If it's not an opened issue with this error, you could open one on our
> bug tracker, so it won't be lost in mails.

Well, it's a really complex environment but I'll see if I can come up
with a simpler repro case.

I just figured that this would be something that's a known issue: since
python is dynamically typed it must be the case that a member can
contain an object where pylint (being a static checker) cannot determine
its type.

Are you saying that Python should NOT be assuming the type as int here?



More information about the code-quality mailing list