I copied the code in this article to implement a dynamic array in python using the ctypes module. Following the author's advice, I began to check the array's size as follows:
import sys
arr = DynamicArray()
for i in range(12):
arr.append(i)
a = len(arr)
b = sys.getsizeof(arr)
print(a, b)
However, the value for b was 56 each time, the same as the size of the empty array.
Does anyone understand what's happening? Why does the array seem to be storing more elements without taking up any more size in the memory?