Structures

Michele Simionato michele.simionato at gmail.com
Tue Nov 4 02:10:10 EST 2008


On Nov 4, 2:57 am, Glenn Linderman <v+pyt... at g.nevcal.com> wrote:
> Note that classes, by default, are based on a contained dict!  There are
> games to be played with slots that can apparently improve that.  I am
> not yet experienced enough with Python to know if a slot is as fast as a
> C struct, but perhaps it is.  

No, slots have nothing to do with speed, they are a memory
optimization. IMO slots fall in the category of premature optimization
and it was a mistake to include them in the language
(the functionality should have been made available only at the C-
level). As of now, lots of people abuse slots without realizing their
disadvantages (for instance, they break multiple inheritance).



More information about the Python-list mailing list