Re:Stop passing naked dictionaries around: Introducing DStru...
by pthatcherg on Saturday November 26, 2011 @02:02AM
(#3279297)
That's funny. I implemented almost the exact same thing a few years ago, although mine is arguably more complete :)
https://github.com/pthatcher/pyrec
Here's my original post about it:
http://www.valuedlessons.com/2009/10/introducing-pyrec-cure-...
And here's my analysis of how much less memory it uses:
There are benefits to using tuples over objects/dictionaries: 1) Lower memory consumption 2) Faster lookups 3) Can be used as dictionary keys, set members, anywhere a hashable (immutable) object is required.