Path: csiph.com!au2pb.net!feeder.erje.net!1.eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!nzpost1.xs4all.net!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'exist,': 0.07; 'cc:addr :python-list': 0.09; 'exist.': 0.09; 'keyed': 0.09; 'subject:ctypes': 0.09; 'thu,': 0.15; '10:59': 0.16; 'argh,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'magic': 0.16; 'wrote:': 0.16; '>>>': 0.20; '2015': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'aug': 0.20; 'meant': 0.22; 'am,': 0.23; 'somewhere': 0.24; 'header:In-Reply-To:1': 0.24; 'chris': 0.26; 'message-id:@mail.gmail.com': 0.27; "i'm": 0.30; 'subject:/': 0.30; 'post': 0.31; 'skip:_ 10': 0.32; "d'aprano": 0.33; 'steven': 0.33; 'received:google.com': 0.35; 'asking': 0.35; 'but': 0.36; 'there': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'method': 0.37; 'wrong': 0.38; 'yes': 0.62; 'chrisa': 0.84; 'of?': 0.84; 'to:none': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=q1VKiBPHzblUEbvwOqQeLOPq/3d2d8ILg2Uq75QvbkI=; b=G62gUSpLWWeVLPumg/a0ih3uQc0ixTqikSgAfEIJABkba1GFck5GA/NlcQDxi3LHHD SVxpA/YxmNh5qHHQLa9iSEAFm+XR3D3eKapxnKtDfjBPibNK16qK6XpT3zRolg8syJNr CAJw4bZkzcpMv7nDV99Qq0iBhLB/zbG/FvTJHzeuVWfvqeXpIjfUhIdIEWrJM6QhyaBG I7F3ehZjzFNMbn3lFaZT+jRr2jxQjmba6LCH4uvuWHE87pxH1OP11A6wnBZQd1LdYRN4 1fgEZTMn5kyWdeClr3vvqJ5a2LBfy9tI5HqmcCagji6ElcAphFe6Xn+mhfBVrTNLPGa8 rnCg== MIME-Version: 1.0 X-Received: by 10.50.114.100 with SMTP id jf4mr10610434igb.94.1440686003130; Thu, 27 Aug 2015 07:33:23 -0700 (PDT) In-Reply-To: <55df099e$0$1638$c3e8da3$5496439d@news.astraweb.com> References: <55df099e$0$1638$c3e8da3$5496439d@news.astraweb.com> Date: Fri, 28 Aug 2015 00:33:22 +1000 Subject: Re: isinstance() and multiple inheritance/ctypes From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 20 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1440686010 news.xs4all.nl 23780 [2001:888:2000:d::a6]:49445 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:95693 On Thu, Aug 27, 2015 at 10:59 PM, Steven D'Aprano wrote: > On Thu, 27 Aug 2015 09:14 am, Chris Angelico wrote: > >> On Thu, Aug 27, 2015 at 9:12 AM, Chris Angelico wrote: >>> Or is there a magic __isinstance__ >> >> Argh, keyed the wrong thing and sent the post prematurely. Meant to say: >> >> Or is there a magic __instancecheck__ method somewhere that I'm not aware >> of? > > Yes -- see Terry Reedy's post. > > isinstance(inst, klass) ends up calling > > type(klass).__instancecheck__(klass, inst) I'm aware that it _can_ exist, but I was asking if one _did_ exist. ChrisA