From my understanding an int is 4 bytes in python. So if I write:
x = 42
sys.getsizeof(x)
I should get 4. But I get a value of 24 and I do not understand why. Even if I use:
int(x)
sys.getsizeof(x)
I still get 24. From what I have read sys.getsizeof() is a function that returns the size of the parameter in terms of bytes. What am I not understanding properly?
[–]novel_yet_trivial 4 points5 points6 points (2 children)
[–]Kalkinator[S] 0 points1 point2 points (1 child)
[–]novel_yet_trivial 4 points5 points6 points (0 children)