On Sun, Jul 17, 2016 at 9:50 PM, Wilson Ong <wilson...@gmail.com> wrote: >> Use this feature sparingly, only when you know that there are going to be >> many (millions rather than thousands) of Test instances. > > Why use it sparingly? Is it for extensibility? What if I'm pretty sure that > my class is going to have exactly these attributes only?
"Pretty sure" isn't enough justification for a relatively meagre saving of memory. Much easier to leave it flexible. It's only once the memory saving stops being "relatively meagre" (for instance, with the built-in 'str' type - there are a LOT of strings in a Python program, since your variable names are stored as strings) that it's worth doing that. ChrisA -- https://mail.python.org/mailman/listinfo/python-list