Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!news.swapon.de!news.stack.nl!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.026 X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; 'class,': 0.07; 'from:addr:ethan': 0.09; 'from:addr:stoneleaf.us': 0.09; 'from:name:ethan furman': 0.09; 'message-id:@stoneleaf.us': 0.09; '~ethan~': 0.09; '(external)': 0.16; 'subject:object': 0.16; 'wrote:': 0.18; 'examples': 0.20; 'header:User-Agent:1': 0.23; 'decide': 0.24; 'header:In-Reply-To:1': 0.27; "d'aprano": 0.31; 'question:': 0.31; 'steven': 0.31; 'another': 0.32; 'case,': 0.35; 'leads': 0.36; 'charset:us-ascii': 0.36; 'two': 0.37; 'to:addr :python-list': 0.38; 'pm,': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'how': 0.40; 'field.': 0.61; 'new': 0.61; 'received:173': 0.61; 'field': 0.63; 'received:gateway14.websitewelcome.com': 0.84; 'subject::': 0.85 Date: Tue, 17 Dec 2013 17:10:49 -0800 From: Ethan Furman User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Type of an object: References: <52af7bfe$0$29976$c3e8da3$5496439d@news.astraweb.com> <52b0006a$0$29973$c3e8da3$5496439d@news.astraweb.com> <52b06902$0$29976$c3e8da3$5496439d@news.astraweb.com> <52b0e36b$0$6512$c3e8da3$5496439d@news.astraweb.com> In-Reply-To: <52b0e36b$0$6512$c3e8da3$5496439d@news.astraweb.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3304.hostgator.com X-AntiAbuse: Original Domain - python.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - stoneleaf.us X-BWhitelist: no X-Source-IP: 173.12.184.233 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: ([173.12.184.233]) [173.12.184.233]:41657 X-Source-Auth: ethan+stoneleaf.us X-Email-Count: 1 X-Source-Cap: dG9idWs7dG9idWs7Z2F0b3IzMzA0Lmhvc3RnYXRvci5jb20= X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 12 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1387330505 news.xs4all.nl 2832 [2001:888:2000:d::a6]:53059 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:62251 On 12/17/2013 03:51 PM, Steven D'Aprano wrote: > > This leads to another question: we've now seen two examples where > (presumably) the internal type field and __class__ differ. In the > weakproxy case, type(obj) returns the internal type field. In the > "regular" case, where you set obj.__class__ to a class, type(obj) returns > the new (external) type. How the hell does it decide which one to return? However it does it, it does it in C. ;) -- ~Ethan~