A RetroSearch Logo

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

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2001-November/018343.html below:

[Python-Dev] Change in evaluation order in new object model

[Python-Dev] Change in evaluation order in new object model [Python-Dev] Change in evaluation order in new object modelTim Peters tim.one@home.com
Fri, 2 Nov 2001 13:38:17 -0500
[Michael McLay]
> ...
> The lookup of a member is also faster because it uses a lookup of
> an offset instead of a dictionary lookup.

There's still a dict lookup:  when you do obj.a where a is a __slot__
attribute of obj.__class__, obj.__class__.__dict__['a'] is looked up in
order to get the descriptor for attribute 'a'.  The fixed set of __slot__
attributes leaves a door open for future optimizations, though (e.g., if
Python could *know* obj.__class__ at compile-time, and know that runtime
code won't overwrite the 'a' descriptor in obj.__class__.__dict__, it could
map obj.a directly to its storage offset (from the base of obj) at
compile-time).




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