![](https://secure.gravatar.com/avatar/3dc5fffe0e94dfa07067a45400213034.jpg?s=120&d=mm&r=g)
Dec. 16, 2011
10:03 a.m.
Greg Ewing wrote:
Mark Shannon wrote:
I have a new dict implementation which allows sharing of keys between objects of the same class.
We already have the __slots__ mechanism for memory savings. Have you done any comparisons with that?
You can't make Python programmers use slots, neither can you automatically change existing programs. Are you suggesting that because the __slots__ mechanism exists, the dict implementation doesn't have to be efficient?
Seems to me that __slots__ ought to save even more memory, since it eliminates the per-instance dict altogether rather than just the keys half of it.
Of course using __slots__ saves more memory, but people don't use them much. Cheers, Mark.