3 ms·
Here's something I implemented a while ago: http://zacharyvoase.github.com/urecord/ http://zacharyvoase.github.com/urecord/ There are benefits to using tuples
by zacharyvoase 15y ago
Here's something I implemented a while ago: http://zacharyvoase.github.com/urecord/ http://zacharyvoase.github.com/urecord/
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.
- pthatcherg 15y agoThat's funny. I implemented almost the exact same thing a few years ago, although mine is arguably more complete :) https://github.com/pthatcher/pyrec https://github.com/pthatcher/pyrec Here's my original post about it: http://www.valuedlessons.com/2009/10/introducing-pyrec-cure-to-bane-of-init.html http://www.valuedlessons.com/2009/10/introducing-pyrec-cure-... And here's my analysis of how much less memory it uses: http://www.valuedlessons.com/2008/10/blog-post.html http://www.valuedlessons.com/2008/10/blog-post.html