Raymond Hettinger added the comment:

>>> from sys import getsizeof
>>> class A:
        def __init__(self, a, b, c, d, e, f):
                self.a = a
                self.b = b
                self.c = c
                self.d = d
                self.e = e
                self.f = f
                
>>> a = A(10, 20, 30, 40, 50, 60)
>>> b = A(10, 20, 30, 40, 50, 60)
>>> c = A(10, 20, 30, 40, 50, 60)
>>> d = A(10, 20, 30, 40, 50, 60)
>>> [getsizeof(vars(inst)) for inst in [a, b, c, d]]
[152, 152, 152, 152]
>>> [getsizeof(dict(vars(inst))) for inst in [a, b, c, d]]
[368, 368, 368, 368]

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28508>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to