Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #95693

Re: isinstance() and multiple inheritance/ctypes

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 <rosuav@gmail.com>
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 <mrlalj$nlt$1@dont-email.me> <CAPTjJmrrFT3aE3vF8nZiw0uxWGCw18YyEFXvOPCtdQDRxiOY7Q@mail.gmail.com> <mailman.68.1440630846.11709.python-list@python.org> <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 <rosuav@gmail.com>
Cc "python-list@python.org" <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 <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.75.1440686010.11709.python-list@python.org> (permalink)
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

Show key headers only | View raw


On Thu, Aug 27, 2015 at 10:59 PM, Steven D'Aprano <steve@pearwood.info> wrote:
> On Thu, 27 Aug 2015 09:14 am, Chris Angelico wrote:
>
>> On Thu, Aug 27, 2015 at 9:12 AM, Chris Angelico <rosuav@gmail.com> 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

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

isinstance() and multiple inheritance/ctypes Rob Gaddi <rgaddi@technologyhighland.invalid> - 2015-08-26 21:21 +0000
  Re: isinstance() and multiple inheritance/ctypes Terry Reedy <tjreedy@udel.edu> - 2015-08-26 17:46 -0400
  Re: isinstance() and multiple inheritance/ctypes Chris Angelico <rosuav@gmail.com> - 2015-08-27 09:12 +1000
    Re: isinstance() and multiple inheritance/ctypes Rob Gaddi <rgaddi@technologyhighland.invalid> - 2015-08-26 23:42 +0000
  Re: isinstance() and multiple inheritance/ctypes Chris Angelico <rosuav@gmail.com> - 2015-08-27 09:14 +1000
    Re: isinstance() and multiple inheritance/ctypes Steven D'Aprano <steve@pearwood.info> - 2015-08-27 22:59 +1000
      Re: isinstance() and multiple inheritance/ctypes Chris Angelico <rosuav@gmail.com> - 2015-08-28 00:33 +1000
        Re: isinstance() and multiple inheritance/ctypes Steven D'Aprano <steve@pearwood.info> - 2015-08-28 13:02 +1000
          Re: isinstance() and multiple inheritance/ctypes Chris Angelico <rosuav@gmail.com> - 2015-08-28 13:25 +1000

csiph-web