A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2006-January/059507.html below:

[Python-Dev] Draft proposal: Implicit self in Python 3.0

[Python-Dev] Draft proposal: Implicit self in Python 3.0 [Python-Dev] Draft proposal: Implicit self in Python 3.0Thomas Wouters thomas at xs4all.net
Sun Jan 8 16:58:16 CET 2006
On Sun, Jan 08, 2006 at 07:35:53AM -0800, Ralf W. Grosse-Kunstleve wrote:

> IIUC, "self" is first looked up in the local dictionary.

No. Local variables are stored in a tuple (more or less,) and indexed by,
er, index. Loading a local variable onto the stack is a fairly fast
operation.

> Please try the code below to see the performance impact. As an alternative to a
> copy/paste exercise try this:
> 
> wget http://cci.lbl.gov/~rwgk/python/self_lookup.py
> python self_lookup.py

> The output with Python 2.4.1/Fedora3/Opteron is:
> 
> loop_function: 13.10
>    loop_class: 17.11

The main difference isn't the lookup of 'self', it's the attribute retrieval
of 'x' from 'self'.

-- 
Thomas Wouters <thomas at xs4all.net>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread!
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4