very true, but python makes it oh so easy to be lazy :-)<br><br><div><span class="gmail_quote">On 4/24/06, <b class="gmail_sendername">Guido van Rossum</b> <<a href="mailto:guido@python.org">guido@python.org</a>> wrote:
</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">On 4/23/06, "Martin v. Löwis" <<a href="mailto:martin@v.loewis.de">martin@v.loewis.de
</a>> wrote:<br>> Kirat Singh wrote:<br>> > The reason I looked into this to begin with was that my code used up a<br>> > bunch of memory which was traceable to lots of little objects with<br>> > instance dicts, so it seemed that if instancedicts took less memory I
<br>> > wouldn't have to go and add __slots__ to a bunch of my classes, or<br>> > rewrite things as tuples/lists, etc.<br>><br>> Ah. In that case, I would be curious if tuning PyDict_MINSIZE could<br>> help. If you have many objects of the same type, am I right assuming
<br>> they all have the same number of dictionary keys? If so, what is the<br>> dictionary size? Do they use ma_smalltable, or do they have an extra<br>> ma_table?<br><br>But the space savings by using __slots__ is so much bigger! (And less
<br>work than hacking the C code too. :-)<br><br>--<br>--Guido van Rossum (home page: <a href="http://www.python.org/~guido/">http://www.python.org/~guido/</a>)<br></blockquote></div><br>