Don't use __slots__ (was Re: performance of dictionary lookup vs. object attributes)

bearophileHUGS at lycos.com bearophileHUGS at lycos.com
Fri Aug 25 13:38:56 EDT 2006


Aahz wrote:
> Taking a look at __slots__ is fine as long as you don't actually use them.

I remember the recent discussion about such matters... but I don't
understand its dangers fully still.
I assume __slots__ may be removed in Python 3.0, but maybe "experts"
need it now an then. Or maybe a "experts only" warning can be added to
the docs.
I think that the official python documentation has to become more like
wikipedia, where people can fix it more easely, so I can add such
warning into the text.
The standard python docs on the Python site can also enjoy a good
amount of usage examples, one example for each thing shown (like in the
really good Delphi manuals).
(I think an unofficial timid example of python docs is being already
recently)

Bye,
bearophile




More information about the Python-list mailing list