Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed5.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.005 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'subject:Python': 0.05; 'type,': 0.07; 'python': 0.09; '22,': 0.09; 'aug': 0.13; 'a()': 0.16; 'finney': 0.16; 'subject:Objects': 0.16; 'wed,': 0.16; 'wrote:': 0.17; '>>>': 0.18; 'cheers,': 0.23; 'pass': 0.25; 'header:In-Reply-To:1': 0.25; 'strongly': 0.27; 'then.': 0.27; 'message-id:@mail.gmail.com': 0.27; 'changed.': 0.29; 'objects': 0.29; 'class': 0.29; 'to:addr:python-list': 0.33; "can't": 0.34; 'received:google.com': 0.34; 'ben': 0.35; 'false': 0.35; 'pm,': 0.35; 'received:209.85': 0.35; 'except': 0.36; 'received:209': 0.37; 'subject:: ': 0.38; 'object': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; '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-type; bh=uN/PWU3CEWVMIooISwWs/7zI5BkSvUo13Hs/OS8yx5Q=; b=n/KhRlyjZCKu+7Q3G9XZhbQ7s1V1SaIzbEl/Le9ivnzaosVbqVeZAetQ8FaI96BdCP xeIezw9G9bz4mVK235vpoYlGCN+E8CDH3Kd4ThuEg23lQwdEvLegk4H3O6tHlxCsHeym euKSml29vrz2Uj6TMyQd/owajvcrgJ3EEIaqfvQI+BKy3nZv4e+hfzhejLPSf+MEixui 0F7L6DJOtFQRsyOkmNEwxxn2TlmG/HBE5is34hbj+zqAzkqwXuIgmRJqqJ/z3fPImUcy YlT64jVYD7SHauFOLSkVKi1QniOFyDE8DsED2CAGWVX07cxqvsdV8QZePYjrKN0KfkJT qsTw== MIME-Version: 1.0 In-Reply-To: <87d32i1ntc.fsf@benfinney.id.au> References: <18409992-1e28-4721-8e64-60c69668da4e@googlegroups.com> <87d32i1ntc.fsf@benfinney.id.au> From: Ian Kelly Date: Wed, 22 Aug 2012 18:10:08 -0600 Subject: Re: Objects in Python To: Python Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 26 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1345680647 news.xs4all.nl 6860 [2001:888:2000:d::a6]:46894 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:27688 On Wed, Aug 22, 2012 at 5:58 PM, Ben Finney wrote: > Those people are confused, then. Python is strongly typed: objects > always know their type, the type is always exact, and the type of an > object can't be changed. Except when it can. >>> class A: pass ... >>> class B: pass ... >>> a = A() >>> type(a) >>> isinstance(a, B) False >>> a.__class__ = B >>> type(a) >>> isinstance(a, A) False >>> isinstance(a, B) True Cheers, Ian