This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Python gdb.Function is an old-style class?


> On Jul 21, 2016, at 1:38 PM, Paul Koning <Paul_Koning@dell.com> wrote:
> 
> 
>> On Jul 21, 2016, at 1:22 PM, Paul Smith <psmith@gnu.org> wrote:
>> 
>> Hi all; I am writing some Python functions that subclass from
>> gdb.Function, and I use super() to call the superclass __init__()
>> 
>> It works, but pylint is failing with an error "Use of super on an old
>> style class".  This is usually shown when a Python2 class does not
>> inherit, ultimately, from the object.
>> 
>> Is there something magic that needs to happen to make gdb.Function
>> recognized as a new-style class?
> 
> You could just call gdb.Function.__init__(self) explicitly rather than the syntactic sugar of super(). 

I just tried the example shown in the manual, and it runs without errors.  I don't get the error message you quoted, and the resulting function works correctly.

So disregard my previous comment about subclassing.  Sorry about the confusion.

	paul


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]