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/2001-November/018336.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 modelDavid Ascher DavidA@ActiveState.com
Fri, 02 Nov 2001 09:39:25 -0800
"M.-A. Lemburg" wrote:

> Could someone please first explain what these slots are used for
> in the first place :-? There must be some difference to standard
> class attributes... which is probably also the reason for the
> above behaviour (even though it does look like a bug to me).

My understanding is that the slots define the set of attributes-like
things that instances of that class can have.  It 'robs' the instances
of such classes from having a __dict__ (at least conceptually), and
provides much lighter weight attributes.  Instances only need to store
the _values_ in a struct/array, while the set of slot names and their
order (in memory) is kept at the class level.

This sort of thing is helpful from a memory point of view when you're
dealing with e.g. large numbers of similar objects  which all share the
same attribute set (coordinates, Tk labels, whatnot).

It doesn't explain (to me at least) why the lookup order is different.

--david



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