I have the following code.
Why is the size of list/tuple lesser than the sum of size of individual elements?
Also why are the sizes of bool and integer 28 bytes?
list_eg = [1,2,3,4,5,"dfd",True,3.1415]
tuple_eg = (1,2,3,4,5,"dfd",True,3.1415)
print(sys.getsizeof(list_eg))
print(sys.getsizeof(tuple_eg))
128
112
print(sys.getsizeof("dfd"))
print(sys.getsizeof(3.1415))
print(5*sys.getsizeof(3))
print(sys.getsizeof(True))
52
24
140
28
print(52+
24+
140+
28)
244