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

Aahz aahz at
Wed Mar 15 16:13:21 CET 2006

In article <dv8vi5$pge$1 at>,
=?ISO-8859-1?Q?Sch=FCle_Daniel?=  <uval at> 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           <*>

"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