Is there a data structure in Python(considering only built-in libraries with version 3.6x) that could meet with both of the following reqs?
1) allocate memory space sequentially, as the array structure in C provides (Or resembles C#'s LayoutKind.Sequential, Pack= 1). and
2) store custom types.(the elements in the structure would be guaranteed by design to be of the same custom type)
Things I have thought of but doesn't work:
meets 1) but fails 2): array.array
satisfies 2) but fails to meet 1): list... etc.
EDIT : As Graipher pointed out in the comment below, and the link he provides. List structure is actually an "array of pointers to Py_Objects". While that technically meets 1) that the memory is sequentially allocated, the data structure I am looking for should sequentially allocate objects, instead of object pointers.
Did I miss any handy data structure provided? Or what tricks out there could provide me with the features I want? Thanks in advance.