Email [Python-projects] New-style classes and pylint

from
Daniel Woods Bullok <dan.devel at bullok dot com>
subject
[Python-projects] New-style classes and pylint
date
2004/04/07 15:14
pylint doesn't seem to like the new style classes (anything inherited from 
object), or the associated built-in "super".  It's complaining about the 
following code:
...
20:class ObjPipeBase(object):
21:    "Abstract base class for object pipes."
22:    _open_mode = None
23:    def __init__ (self, pipe_name = None):
...
59:class ObjPipeSender(ObjPipeBase):
60:    "Sends objects through a data pipe (fifo) to another process" 
61:    _open_mode = 'w' # write mode
62:    def __init__ (self, pipe_name = None, always_flush = True):
63:        "output is flushed after every operation if always_flush is True."
64:        super(ObjPipeSender, self).__init__(pipe_name)
...

************* Module objpipe
F: 23:ObjPipeBase.__init__: Unable to resolve (object)
W: 64:ObjPipeSender.__init__: __init__ method from a non direct base class 
'super(ObjPipeSender, self)' is called
W: 62:ObjPipeSender.__init__: __init__ method from base class 'ObjPipeBase' is 
not called

I assume that pylint just doesn't know about new style classes yet, because 
the above code is how you're supposed to handle superclass method invocation.

-Dan
_______________________________________________
Python-Projects mailing list
Python-Projects@lists.logilab.org
http://lists.logilab.org/mailman/listinfo/python-projects


has reply