<style type="text/css"> p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 24.0px 'D2Coding ligature'; color: #f2f2f2; background-color: #000000; background-color: rgba(0, 0, 0, 0.62)} span.s1 {font-variant-ligatures: no-common-ligatures} </style>
>>> class test:
... def __init__(self):
... self.a=self.b=self.c=None
...
>>> t=test()
>>> t.a=1
>>> t.b=2
>>> t.c=1
>>> sys.getsizeof(t)
64
>>> sys.getsizeof(t.a)
28
>>>
>>> class test:
... def __init__(self):
... self.a=self.b=None
...
>>> t=test()
>>> t.a=1
>>> t.b=1
>>> sys.getsizeof(t.a)
28
>>> sys.getsizeof(t)
<style type="text/css"> p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 24.0px 'D2Coding ligature'; color: #f2f2f2; background-color: #000000; background-color: rgba(0, 0, 0, 0.62)} span.s1 {font-variant-ligatures: no-common-ligatures} </style>
64
멤버 변수를 늘려도 객체의 크기가 같은데...
내부에서 어떻게 돌아가고 있는거죠? ㅠㅠ
파이썬은 getsizeof로 사이즈 못 재요
메모리 크기는 알 수 있지 않나여? 아님 getsizeof(객체) 썼을 때 포인터 크기만 나오는거?