7 ms·
Python: What the Hell is a Slot?
- jrockway 17y agoA 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.
- cpr 17y agoMaybe 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?
- alphazero 17y agoGiven an unknown object, how would your program distinguish between meta-info and property?
- kragen 17y agoThere is. ZODB uses it to provide software transactional memory. __slots__ is just a handy feature of the default metaclass, IIRC.