Message290536
| Author |
rhettinger |
| Recipients |
benjamin.peterson, loewis, pitrou, rhettinger, serhiy.storchaka |
| Date |
2017年03月26日.16:02:43 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1490544163.31.0.764435638456.issue12414@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Not including the Python accessible referred-to objects is consistent with how sys.getsizeof() works elsewhere (i.e. for object instances, the size of __dict__ is not included).
>>> import sys
>>> class A:
pass
>>> a = A()
>>> sys.getsizeof(a)
56
>>> sys.getsizeof(a.__dict__)
112
The result is easily misleading but this seems to have been an early design decision about the semanatics __sizeof__. |
|