|
|
|
|
|
by xapata
2985 days ago
|
|
That's a silly example. If you're making billions of integers, use NumPy. If it's just one pass, use a generator. If you're making lots of objects with more interesting attributes, the attribute storage will overwhelm the difference the instance dicts make. My point was not that __slots__ does nothing, but that there are more important things to worry about. |
|
I claim that in this case, __slots__ is exactly the right thing to worry about.