Path: csiph.com!usenet.pasdenom.info!gegeweb.org!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed1a.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.013 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'subject:Python': 0.06; "'a'": 0.09; 'differently.': 0.09; 'python:': 0.09; 'cc:addr :python-list': 0.11; 'python': 0.11; 'def': 0.12; 'a()': 0.16; 'behave': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'wrote:': 0.18; 'wed,': 0.18; 'feb': 0.22; '>>>': 0.22; 'preferred': 0.22; 'saying': 0.22; 'cc:addr:python.org': 0.22; 'print': 0.22; 'cc:2**0': 0.24; 'class.': 0.26; 'header:In- Reply-To:1': 0.27; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'class': 0.32; 'subject: (': 0.35; 'created': 0.35; 'knows': 0.35; 'no,': 0.35; 'received:google.com': 0.35; 'should': 0.36; 'either': 0.39; 'kind': 0.63; 'chance': 0.65; 'subject:! ': 0.74; '10:32': 0.84; '2015': 0.84; 'subject:!)': 0.84; 'to:none': 0.92; 'matter),': 0.93 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=gAAtzaj5L2lBXZF67bhmGI5u5Kn6dUJG2ThR1lPCPcs=; b=WU3gOWa7dfXamJzZou6LL5/zV1/VdjP14v3Q3YrLr5uHNyHT7bWm5xDFxvmERiDcaw K8kn07DQwcLSdlgKswUcix7StQ5gk/amqyKATB6hEc9j00lNFkDzAoVhfu6na5VtEAye EnboUZBuGgJE/T0293/GYAfb3RVvV8/X8mknh4LwKGk1FJeQbrdyXDdxuZsJFfgmhBRr ZD2E29QXFvj7mZgdFGadH2T+DgRbnFp1YnqxPlybdiEnKM8c6+8hZ/WKsOIH3E+aiZY5 mGU7LJj4jCDgBjgAvlP/oh52v2r0auuJkxlTaoLoveE/wUGUq/VJu4TYa2MRUn5x/A1g hbww== MIME-Version: 1.0 X-Received: by 10.107.14.131 with SMTP id 125mr31619379ioo.53.1423006781296; Tue, 03 Feb 2015 15:39:41 -0800 (PST) In-Reply-To: <878ugea7wh.fsf@elektro.pacujo.net> References: <54c07d04$0$13012$c3e8da3$5496439d@news.astraweb.com> <54ccc2fc$0$13009$c3e8da3$5496439d@news.astraweb.com> <54cd9a7a$0$12984$c3e8da3$5496439d@news.astraweb.com> <54ce526a$0$13012$c3e8da3$5496439d@news.astraweb.com> <54cf242d$0$12991$c3e8da3$5496439d@news.astraweb.com> <54cf6836$0$12996$c3e8da3$5496439d@news.astraweb.com> <54cf849d$0$13005$c3e8da3$5496439d@news.astraweb.com> <87zj8vgtzk.fsf@elektro.pacujo.net> <87vbjjgrpj.fsf@elektro.pacujo.net> <87egq6adm1.fsf@elektro.pacujo.net> <878ugea7wh.fsf@elektro.pacujo.net> Date: Wed, 4 Feb 2015 10:39:41 +1100 Subject: Re: dunder-docs (was Python is DOOMED! Again!) From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 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: 29 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1423006789 news.xs4all.nl 2905 [2001:888:2000:d::a6]:59418 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:85185 On Wed, Feb 4, 2015 at 10:32 AM, Marko Rauhamaa wrote: > No, I'm saying Python should behave differently. > > Python: > > >>> class A: > ... def f(self): > ... print("f") > ... def g(self): > ... print("g") > ... > >>> a = A() > >>> a.__class__.f = a.__class__.g > >>> a.f() > g > > In my preferred semantics, a.f() would print > > >>> a.f() > f Yeeeouch. So either it has to actually copy everything in on instantiation (stupid cost for the tiny chance that it'll actually ever matter), or else have some kind of versioning that means that it knows that 'a' was created from the pre-changed class. What's the advantage?!? ChrisA