Quesion about the proper use of __slots__

bonono at gmail.com bonono at gmail.com
Mon Feb 20 06:17:05 EST 2006


Zefria wrote:
> Well, my computer tends to run at about 497 to 501 out of 504 MB of RAM
> used once I start up Gnome, XMMS, and a few Firefox tabs, and I'd
> prefer not to see things slipping into Swap space if I can avoid it,
> and the fighter data would be only part of a larger program.
>
> And as I said, learning how to use __slots__ is important enough to
> hazard a premature guess this time around. If I mess up, the worst that
> happens is that I have to write down a new variable name in two places
> instead of one now.

For this particular setup, I don't think it would be a concern given
your mentioned size as you are very unlikely to be actively using all
the apps at the same time and linux is quite efficient in handling it.

However, I don't think attempting to use __slots__ in this case is bad
either. Afterall, one of the strength of python is allowing you to
quickly test out different approachs.




More information about the Python-list mailing list