[Python-projects] Workaround for this serious pylint bug?

Edward K. Ream edreamleo at gmail.com
Wed Jul 2 19:25:10 CEST 2008


Leo benefits greatly from the excellent pylint tool.

Here is a demonstration of what appears to be a serious pylint bug.

There are three files, in the same folder:

# ----- main.py
import baseClass
import subClass

message = 'I *am* defined'
x = subClass.subClass(message)
x.run()

# ----- baseClass.py
class baseClass:
    def __init__(self,message):
        self.message=message

# ----- subClass.py
import baseClass

class subClass (baseClass.baseClass):
    def __init__ (self,message):
        # init the base class
        baseClass.baseClass.__init__(self,message)
    def run(self):
        print self.message

When run, main.py produces the expected message: 'I *am* defined'.

Suppose pylint-leo.bat contains:

echo A demonstration of the pylint bug
call pylint.bat test\pylintTest\subClass.py --rcfile=test\pylint-leo-rc.txt

The output of running this script is:

A demonstration of the pylint bug
************* Module subClass
E1101: 14:subClass.run: Instance of 'subClass' has no 'message' member

This bug has serious consequences for Leo. It makes using pylint much harder
than it otherwise would be.

Is this a known bug?  Is there a workaround?
Thanks,

Edward
--------------------------------------------------------------------
Edward K. Ream email: edreamleo at gmail.com
Leo: http://webpages.charter.net/edreamleo/front.html
--------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.logilab.org/pipermail/python-projects/attachments/20080702/0e00cfea/attachment.htm 


More information about the Python-Projects mailing list