From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 117783 invoked by alias); 21 Jul 2016 17:38:44 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 117771 invoked by uid 89); 21 Jul 2016 17:38:43 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_PASS autolearn=ham version=3.3.2 spammy=H*r:Unknown, H*M:8172, super X-HELO: esa7.dell-outbound.iphmx.com Received: from Unknown (HELO esa7.dell-outbound.iphmx.com) (68.232.153.96) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 21 Jul 2016 17:38:33 +0000 Received: from ausxipps301.us.dell.com ([143.166.148.223]) by esa7.dell-outbound.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Jul 2016 22:38:25 +0500 X-LoopCount0: from 10.175.216.250 From: To: CC: Subject: Re: Python gdb.Function is an old-style class? Date: Thu, 21 Jul 2016 17:38:00 -0000 Message-ID: <442ECA9F-4670-4B4A-8172-8AA7418EF332@dell.com> References: <1469121732.5880.128.camel@gnu.org> In-Reply-To: <1469121732.5880.128.camel@gnu.org> Content-Type: text/plain; charset="us-ascii" Content-ID: <93620DF4BF1E0C4D956511479D0DD791@dell.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-IsSubscribed: yes X-SW-Source: 2016-07/txt/msg00015.txt.bz2 > On Jul 21, 2016, at 1:22 PM, Paul Smith wrote: >=20 > Hi all; I am writing some Python functions that subclass from > gdb.Function, and I use super() to call the superclass __init__() >=20 > 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. >=20 > 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(). But does subclassing work at all? I had the i= mpression that many gdb classes don't allow subclassing. Or it might not b= e rejected but it may not work. I haven't looked at how to make a class in= C that can be subclassed; my impression is that it definitely takes work a= nd I don't know if the necessary magic has been implemented. For example, method calls in subclassable classes have to be via attribute = lookups and Python calls, they can't be direct calls. Ditto data attribute= references. paul