Don't use __slots__ (was Re: __slots__ in derived class)
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.python archive

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

From: Aahz <aahz@pythoncraft.com>
Date: Wed Mar 15 2006 - 16:13:21 CET

In article <dv8vi5$pge$1@news2.rz.uni-karlsruhe.de>,
=?ISO-8859-1?Q?Sch=FCle_Daniel?= <uval@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@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
Received on Sun Apr 30 11:54:41 2006