Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Ian Kelly Newsgroups: comp.lang.python Subject: Re: Making Classes Subclassable Date: Tue, 5 Jul 2016 09:02:22 -0600 Lines: 12 Message-ID: References: <87eg79q1i0.fsf@handshake.de> <337f8071-ef4a-4ac5-867b-a5320c684730@googlegroups.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: 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: X-Mailman-Original-References: <87eg79q1i0.fsf@handshake.de> <337f8071-ef4a-4ac5-867b-a5320c684730@googlegroups.com> Xref: csiph.com comp.lang.python:111128 On Mon, Jul 4, 2016 at 2:34 AM, Lawrence D=E2=80=99Oliveiro 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__().