Don't use __slots__ (was Re: __slots__ in derived class)

Aahz aahz at pythoncraft.com
Wed Mar 15 10:13:21 EST 2006


In article <dv8vi5$pge$1 at news2.rz.uni-karlsruhe.de>,
=?ISO-8859-1?Q?Sch=FCle_Daniel?=  <uval at rz.uni-karlsruhe.de> wrote:
>
>does __slots__ nothing when used in derived classes?

Short answer: don't use __slots__ until you're comfortable writing
metaclasses and decorators.  __slots__ are a performance hack strictly
for advanced users, and if you think you need them, you probably don't.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"19. A language that doesn't affect the way you think about programming,
is not worth knowing."  --Alan Perlis



More information about the Python-list mailing list