Re: [Python-Dev] cpython: Use cached builtins.

2013-10-03 Thread Michael Foord
On 3 Oct 2013, at 12:05, Nick Coghlan wrote: > > On 3 Oct 2013 06:00, "Victor Stinner" wrote: > > > > I don't remember where, but I remember that I also saw things like > > "str=str, len=len, ...". So you keep the same name, but you use fast > > local lookups instead of slow builtin lookups. >

Re: [Python-Dev] cpython: Use cached builtins.

2013-10-03 Thread Nick Coghlan
On 3 Oct 2013 06:00, "Victor Stinner" wrote: > > I don't remember where, but I remember that I also saw things like > "str=str, len=len, ...". So you keep the same name, but you use fast > local lookups instead of slow builtin lookups. functools uses the local binding trick in lru_cache as a spee

Re: [Python-Dev] cpython: Use cached builtins.

2013-10-03 Thread Georg Brandl
Am 02.10.2013 21:58, schrieb Victor Stinner: > I don't remember where, but I remember that I also saw things like > "str=str, len=len, ...". So you keep the same name, but you use fast > local lookups instead of slow builtin lookups. In this case they aren't even fast local lookups but (slightly)

Re: [Python-Dev] cpython: Use cached builtins.

2013-10-02 Thread Victor Stinner
I don't remember where, but I remember that I also saw things like "str=str, len=len, ...". So you keep the same name, but you use fast local lookups instead of slow builtin lookups. Victor 2013/10/2 Antoine Pitrou : > On Wed, 2 Oct 2013 18:16:48 +0200 (CEST) > serhiy.storchaka wrote: >> http:/

Re: [Python-Dev] cpython: Use cached builtins.

2013-10-02 Thread Serhiy Storchaka
02.10.13 20:31, Antoine Pitrou написав(ла): On Wed, 2 Oct 2013 18:16:48 +0200 (CEST) serhiy.storchaka wrote: http://hg.python.org/cpython/rev/d48ac94e365f changeset: 85931:d48ac94e365f user:Serhiy Storchaka date:Wed Oct 02 19:15:54 2013 +0300 summary: Use cached builtins.

Re: [Python-Dev] cpython: Use cached builtins.

2013-10-02 Thread Ned Batchelder
On 10/2/13 1:31 PM, Antoine Pitrou wrote: On Wed, 2 Oct 2013 18:16:48 +0200 (CEST) serhiy.storchaka wrote: http://hg.python.org/cpython/rev/d48ac94e365f changeset: 85931:d48ac94e365f user:Serhiy Storchaka date:Wed Oct 02 19:15:54 2013 +0300 summary: Use cached builtins.

Re: [Python-Dev] cpython: Use cached builtins.

2013-10-02 Thread Antoine Pitrou
On Wed, 2 Oct 2013 18:16:48 +0200 (CEST) serhiy.storchaka wrote: > http://hg.python.org/cpython/rev/d48ac94e365f > changeset: 85931:d48ac94e365f > user:Serhiy Storchaka > date:Wed Oct 02 19:15:54 2013 +0300 > summary: > Use cached builtins. What's the point? I don't think it