Message198107
| Author |
pitrou |
| Recipients |
amaury.forgeotdarc, loewis, pitrou, rhettinger, serhiy.storchaka |
| Date |
2013年09月19日.18:17:46 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1379614666.43.0.926228207973.issue19048@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Here is why using get_referents() is stupid in the general case:
>>> class C: pass
...
>>> c = C()
>>> gc.get_referents(c)
[<class '__main__.C'>]
With your method, measuring c's memory consumption also includes the memory consumption of its type object.
(and of course this is only a trivial example... one can only imagine what kind of mess it is with a non-trivial object) |
|