Hacker News new | past | comments | ask | show | jobs | submit login
Python: What the Hell is a Slot? (elfsternberg.com)
45 points by iamelgringo on July 7, 2009 | hide | past | favorite | 4 comments



A nice feature, but it's too bad there is not a full instance metaclass for precisely controlling how each instance is stored. Perl and Common Lisp have this.


Maybe I don't understand all that "full instance metaclass" implies, but if you use properties, you can control how each member is handled. With properties for each instance member, seems like you have total control.

Or is that just not convenient or powerful enough?


Given an unknown object, how would your program distinguish between meta-info and property?


There is. ZODB uses it to provide software transactional memory. __slots__ is just a handy feature of the default metaclass, IIRC.




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

Search: