Author amaury.forgeotdarc
Recipients amaury.forgeotdarc, benjamin.peterson, facundobatista, schuppenies
Date 2008-06-27.09:49:00
SpamBayes Score 0.000326974
Marked as misclassified No
Message-id <>
> Caching itself is no criteria, but allocating memory without giving
> the user a chance to find out should be (in this context).
> ... calling match.regs creates a
> tuple which is not there before, but cannot be removed
> afterwards. This is why I handled it separately.

Well, so why only include the tuple, and not objects inside the tuple?
They may also count in allocated memory (not often: small numbers are

Does the same criteria apply to function.func_defaults and function.doc
members? Both can be None, sizeof(None) would be added twice.

Would you say the same for property members?

class C(object):
   def setx(self): self.__x = 42
   x = property(lambda self: self.__x)

the value is not there before you call o.setx(), and cannot be removed

IMO, the criteria (to decide whether a container should include a
particular PyObject member in its sizeof) should not include the way the
member  is created, or who created it, but only the current layout in
memory. For example: can other objects hold references to this member,
does it appear in gc.objects...

And I propose this simple algorithm: do not include any referenced
PyObject :-)
Date User Action Args
2008-06-27 09:49:03amaury.forgeotdarcsetspambayes_score: 0.000326974 -> 0.000326974
recipients: + amaury.forgeotdarc, facundobatista, benjamin.peterson, schuppenies
2008-06-27 09:49:03amaury.forgeotdarcsetspambayes_score: 0.000326974 -> 0.000326974
messageid: <>
2008-06-27 09:49:01amaury.forgeotdarclinkissue3122 messages
2008-06-27 09:49:00amaury.forgeotdarccreate