Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



Sounds 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.


You missed his point 1.


Ok. Then my answer belongs to the first in the sub-tree. What I actually did not understand: What means TFA?


The Freaking Article.


Thanks! That helps.


The Featured Article.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: