
How much memory does a Python list use? sys.getsizeof will tell you, sort of: It reports the memory used by the list, but not its elements:
>>> import sys
>>> x = [10, 20, 30, 40, 50]
>>> sys.getsizeof(x)
104
>>> x[0] = 'abcdefghij' * 100_000_000
>>> sys.getsizeof(x)
104
