Alexander Eisenhuth wrote: > - what is the reason, that __slots__ are introduced in python?
When you have "many" instances of a class with a fixed set of attributes __slots__ can save you some memory because it avoids the overhead for the instance __dict__. Note that "many" means millions rather than thousands. The best approach is to measure the memory footprint of your app with and without __slots__ in the class you see as a good candidate and only use it when you find a significant difference. > - I want to use slots to define a class where no attributes are added at > runtime. Is that a good idea to use slots for that? No. Peter -- http://mail.python.org/mailman/listinfo/python-list