This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author loewis
Recipients georg.brandl, gvanrossum, loewis, rhettinger, schuppenies
Date 2008-05-19.20:48:09
SpamBayes Score 0.17608088
Marked as misclassified No
Message-id <>
In-reply-to <>
> I'm torn about the extra slot; I'd rather not add one, but I can't see
> how to make this flexible enough without one.

I think adding a default __sizeof__ implementation into object
(__basicsize__ + len()*__itemsize__), plus overriding that in
subclasses, should do the trick.

Not adding the default into object would cause an exception to be
raised whenever sys.sizeof checks for __sizeof__, which is fairly

Having to look __sizeof__ up in the class dictionary, and
creating an argument list, is still fairly expensive (given that the
application we have in mind will apply sizeof to all objects,
repeatedly), however, this being a debugging facility, this overhead is
probably ok.
Date User Action Args
2008-05-19 20:48:12loewissetspambayes_score: 0.176081 -> 0.17608088
recipients: + loewis, gvanrossum, georg.brandl, rhettinger, schuppenies
2008-05-19 20:48:11loewislinkissue2898 messages
2008-05-19 20:48:10loewiscreate