Group: comp.lang.python


Subject: Don't use __slots__ (was Re: Why custom objects take so much memory?)
From: aahz@pythoncraft.com (Aahz)
Date: 12/18/2007 1:49:25 PM
In article <mailman.2538.1198008758.13605.python-list@python.org>, Chris Mellon <arkanes@gmail.com> wrote: > >You can reduce the size of new-style classes (inherit from object) by >quite a bit if you use __slots__ to eliminate the class dictionary. You can also reduce your functionality quite a bit by using __slots__. Someday I'll have time to write up a proper page about why you shouldn't use __slots__.... -- Aahz (aahz@pythoncraft.com) <*> http://www.pythoncraft.com/ "Typing is cheap. Thinking is expensive." --Roy Smith