class test:
x = []
def __init__(self, n):
x = list(range(n))
z=test(500)
sys.getsizeof(z)
56
sys.getsizeof(z.x)
4608
This is not consistent. I need to compute the size of an object I created. How do I do that?
class test:
x = []
def __init__(self, n):
x = list(range(n))
z=test(500)
sys.getsizeof(z)
56
sys.getsizeof(z.x)
4608
This is not consistent. I need to compute the size of an object I created. How do I do that?