4 ms·
1. __slots__ and TFA have nothing to do with one another 2. __slots__ are not actually useful, Pypy does what they do by default and deoptimizes as needed, CPy
by masklinn 12y ago
1. __slots__ and TFA have nothing to do with one another
2. __slots__ are not actually useful, Pypy does what they do by default and deoptimizes as needed, CPython probably could as well
3. the only thing __slots__ do is lower memory usage (by not allocating a dict per instance) and PEP 412 has already improved that
__slots__ is not "crazy useful" by any definition of the expression, it is somewhat useful when you have a huge living number of simple objects.
- PythonicAlpha 12y agoSounds as, that you did not understand, that the author did not mean the __slots__ system, that allows to avoid the __dict__ on objects, but the internal slots-system that is intended to speed up the dispatching of special methods.
- thu 12y agoYou missed his point 1.
- PythonicAlpha 12y agoOk. Then my answer belongs to the first in the sub-tree. What I actually did not understand: What means TFA?
- deleted 12y ago[deleted]
- stewartbutler 12y agoThe Freaking Article.
- PythonicAlpha 12y agoThanks! That helps.
- tripzilch 12y agoThe Featured Article.