Path: csiph.com!usenet.pasdenom.info!news.etla.org!nntp-feed.chiark.greenend.org.uk!ewrotcd!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Gregory Ewing Newsgroups: comp.lang.python Subject: Re: dunder-docs (was Python is DOOMED! Again!) Date: Wed, 04 Feb 2015 11:43:48 +1300 Lines: 16 Message-ID: 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> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net FsWzAu8x6Hi5Aq9kUhcUqwSVNMRZKD6/A0vcKHC34fOSbqZglQ Cancel-Lock: sha1:rLNBar+vSk4P+Q95lIKNbH1BRJA= User-Agent: Mozilla Thunderbird 1.0.5 (Macintosh/20050711) X-Accept-Language: en-us, en In-Reply-To: <87egq6adm1.fsf@elektro.pacujo.net> Xref: csiph.com comp.lang.python:85182 Marko Rauhamaa wrote: > Right now Python generates the trampoline from the class prototype every > time you call a method. If the semantics allowed, you could create the > trampoline at instantiation time (for better or worse). That way, the > problem you seem to be referring to wouldn't materialize. Sorry, I misinterpreted what you were suggesting. You seem to be suggesting an optimisation that pre-creates bound methods when the instance is created. Keeping a cache of bound methods would achieve the same thing without changing the semantics. I think CPython might already be doing that, but I'm not sure. -- Greg