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


Groups > comp.lang.python > #111128

Re: Making Classes Subclassable

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From Ian Kelly <ian.g.kelly@gmail.com>
Newsgroups comp.lang.python
Subject Re: Making Classes Subclassable
Date Tue, 5 Jul 2016 09:02:22 -0600
Lines 12
Message-ID <mailman.101.1467730990.2295.python-list@python.org> (permalink)
References <ca1ee22e-9769-4e76-81f3-b9d0dcb55212@googlegroups.com> <87eg79q1i0.fsf@handshake.de> <mailman.59.1467619073.2295.python-list@python.org> <337f8071-ef4a-4ac5-867b-a5320c684730@googlegroups.com> <CALwzidm6g4mm0zG+3qdQNqdy+RH-uCHm45pP30JZnFsjYhrA7w@mail.gmail.com>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding quoted-printable
X-Trace news.uni-berlin.de 8GhRdyZL4O6Rhw7OYLx4MQSMbIj07u9jjRi43PxoPLIA==
Return-Path <ian.g.kelly@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.009
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; 'remaining': 0.07; 'preferable': 0.09; 'python': 0.10; '(there': 0.16; '2016': 0.16; 'assignable': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'subject:Classes': 0.16; 'uses,': 0.16; 'wrote:': 0.16; 'preferred': 0.20; 'lawrence': 0.22; 'am,': 0.23; 'header:In- Reply-To:1': 0.24; 'mon,': 0.24; 'not.': 0.27; 'message- id:@mail.gmail.com': 0.27; 'though,': 0.32; 'received:google.com': 0.35; 'monday,': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'difference': 0.38; 'to:addr:python.org': 0.40; 'jul': 0.72; 'subject:Making': 0.84; 'to:name:python': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-transfer-encoding; bh=QwiUXyU0W8mb0gr+fMgfhSX5lddX+NOBXKNE/VfX5Vw=; b=tGN6caSEgaY+XaGwDlvrOzCbeq3eKhh+HSPTz6vdQ+m5MLr9NY7TE2LVg4brnhNlBe ae8PRC6ya9krQA4tbbAtS0eWHnWCla1Kp3kDeZ3qxT7Vr2pa2ZGD7LMqHy27Qzeop4AS qDYnmXDe/oyfvVTCXNkFlKUwnCWPTk+K9lFwOe0e5/EpUfxt8Tg+peQNA5rrn0oqYBaj t9N3RgmbjFJamKm2HtEExHkZggI+b1AAFXamnKVW8geDMl+jDHbEipZS8VdbBWU43+qG p/e5N4wpxeERPAcV0yrKz6UAFD2l98ohPgIx+Lfx5N5E7c7E/n8xsuz9FsxXTr7cCsCC fXIA==
X-Google-DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-transfer-encoding; bh=QwiUXyU0W8mb0gr+fMgfhSX5lddX+NOBXKNE/VfX5Vw=; b=Z5obsaAgB4hd7FDluozqQubvEoHtm/SDIJSFYvbUAbizCnQ/3eZEXbqgoCL6qizbXL Q7oZ2Vn8zflxri5DgA9Yka0GDLPA+nxqhO8xHaAMhfRJvWJ7TOHFkh2FMhw0saYo8Qzj rRJmsJ7J3ZyX33aZ0/fzQYWLEUa/v0g8A28VbWzx1yRlVgmH2LgLH0FLPpLTGBxwGlm6 98InO4yuYlOayWsw8TIh3VcW+moaKtuIoohjDixuqG/GtnRohZBiPz2XBJ/+6lah19XL 4g1SsqrSgp3Bp8Rp+vxVUOyNQBq/oSoVaspprcdVT8nkA50jfEssYiScb2CoWmhS61rV IMRw==
X-Gm-Message-State ALyK8tJ4uwzoD1M+OcVRbUuy0D7+mroR2u6C607uyMsG6W9TcJb6UrDnwIrRaeigbmiIC3R0B3q8YweyzNBLNw==
X-Received by 10.55.38.197 with SMTP id m66mr18268578qkm.208.1467730982328; Tue, 05 Jul 2016 08:03:02 -0700 (PDT)
In-Reply-To <337f8071-ef4a-4ac5-867b-a5320c684730@googlegroups.com>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.22
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>
X-Mailman-Original-Message-ID <CALwzidm6g4mm0zG+3qdQNqdy+RH-uCHm45pP30JZnFsjYhrA7w@mail.gmail.com>
X-Mailman-Original-References <ca1ee22e-9769-4e76-81f3-b9d0dcb55212@googlegroups.com> <87eg79q1i0.fsf@handshake.de> <mailman.59.1467619073.2295.python-list@python.org> <337f8071-ef4a-4ac5-867b-a5320c684730@googlegroups.com>
Xref csiph.com comp.lang.python:111128

Show key headers only | View raw


On Mon, Jul 4, 2016 at 2:34 AM, Lawrence D’Oliveiro
<lawrencedo99@gmail.com> wrote:
> On Monday, July 4, 2016 at 7:58:07 PM UTC+12, dieter wrote:
>> --> "type(obj)" or "obj.__class__" (there are small differences)
>> give you the type/class of "obj".
>
> When would it not be the same?

I think the only remaining difference in Python 3 is that
obj.__class__ is assignable and type(obj) is not. For most uses,
type(obj) would be preferred though, in the same way that len(obj) is
preferable to obj.__len__().

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


Thread

Making Classes Subclassable Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-07-02 21:31 -0700
  Re: Making Classes Subclassable dieter <dieter@handshake.de> - 2016-07-04 09:57 +0200
    Re: Making Classes Subclassable Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-07-04 01:34 -0700
      Re: Making Classes Subclassable Michael Selik <michael.selik@gmail.com> - 2016-07-05 05:26 +0000
        Re: Making Classes Subclassable Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-07-05 00:08 -0700
      Re: Making Classes Subclassable dieter <dieter@handshake.de> - 2016-07-05 09:55 +0200
      Re: Making Classes Subclassable Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2016-07-05 18:31 +1000
        Re: Making Classes Subclassable Ian Kelly <ian.g.kelly@gmail.com> - 2016-07-05 08:41 -0600
          Re: Making Classes Subclassable Steven D'Aprano <steve@pearwood.info> - 2016-07-06 01:33 +1000
      Re: Making Classes Subclassable Ian Kelly <ian.g.kelly@gmail.com> - 2016-07-05 09:02 -0600
        Re: Making Classes Subclassable Steven D'Aprano <steve@pearwood.info> - 2016-07-06 01:41 +1000
        Re: Making Classes Subclassable Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-07-05 19:31 -0700
    Re: Making Classes Subclassable Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-07-05 20:04 -0700
  Re: Making Classes Subclassable Ian Kelly <ian.g.kelly@gmail.com> - 2016-07-05 08:52 -0600

csiph-web