Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: "Sven R. Kunze" Newsgroups: comp.lang.python Subject: Re: Efficient Wrappers for Instance Methods Date: Thu, 4 Feb 2016 17:18:21 +0100 Lines: 13 Message-ID: References: <56B263C1.7030309@mail.de> <56B26940.3090609@mail.de> <56B26D3D.6040703@mail.de> <56B2747B.6050209@mail.de> <1454543258.197018.511336178.74125AA7@webmail.messagingengine.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de QhgHaAkfsTeS3foHRVbM2wxjc6J6NKs6vmtXvhwabn7A== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.031 X-Spam-Evidence: '*H*': 0.94; '*S*': 0.00; 'inherited': 0.09; 'wed,': 0.15; 'heap': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'wrote:': 0.16; 'case.': 0.18; 'to:2**1': 0.21; 'mind.': 0.22; 'feb': 0.23; 'header:In-Reply-To:1': 0.24; 'header:User-Agent:1': 0.26; 'idea': 0.28; 'creating': 0.30; 'class.': 0.30; 'class': 0.33; 'instances': 0.33; "i'll": 0.33; 'changing': 0.34; 'received:10.0': 0.34; 'best,': 0.35; 'there': 0.36; 'to:addr :python-list': 0.36; 'subject:: ': 0.37; 'received:10': 0.37; 'method': 0.37; 'to:addr:python.org': 0.40; 'received:de': 0.40; 'your': 0.60; 'charset:windows-1252': 0.62 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mail.de; s=mail201212; t=1454602705; bh=mRGIQ1ka6RE+1N3n2hgOjhJKl1rEEUcSSN6bGMuFGCc=; h=Subject:To:References:From:Date:In-Reply-To:From; b=E4aYOd5+ua4ZocGI1hbtZnlN3Grr8JqMFaYqkv9apAUeGXnplKI9qYpOZWekpz4vw 4uBYDbevQHFWu2BsAA7eMnehcE6Ak0SjyB4swVbd6xHMzJsHm9jZECFNZCeyqvLVgL /ke1a1oyEab5gPCcwg9pysWvPg5QGNB2JX10YGLk= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 In-Reply-To: <1454543258.197018.511336178.74125AA7@webmail.messagingengine.com> X-purgate: clean X-purgate: This mail is considered clean (visit http://www.eleven.de for further information) X-purgate-type: clean X-purgate-Ad: Categorized by eleven eXpurgate (R) http://www.eleven.de X-purgate: This mail is considered clean (visit http://www.eleven.de for further information) X-purgate: clean X-purgate-size: 557 X-purgate-ID: 154282::1454602705-000009F3-BEC8E9FE/0/0 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.21rc1 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:102502 On 04.02.2016 00:47, Random832 wrote: > On Wed, Feb 3, 2016, at 16:43, Sven R. Kunze wrote: >> Actually a nice idea if there were no overhead of creating methods for >> all heap instances separately. I'll keep that in mind. :) > What about changing the class of the object to one which is inherited > from its original class and has the method you want? What about reaching > into the class and changing the method in the first place? Either may > not be appropriate, of course, depending on your use case. There is no base class. Best, Sven