<s>[INST] Python List vs. Array - when to use? If you are creating a 1d array, you can implement it as a List, or else use the 'array' module in the standard library.  I have always used Lists for 1d arrays.
What is the reason or circumstance where I would want to use the array module instead?
Is it for performance and memory optimization, or am I missing something obvious?
 [/INST] Basically, Python lists are very flexible and can hold completely heterogeneous, arbitrary data, and they can be appended to very efficiently, in amortized constant time.  If you need to shrink and grow your array time-efficiently and without hassle, they are the way to go.  But they use a lot more space than C arrays.
The array.array type, on the other hand, is just a thin wrapper on C arrays.  It can hold only homogeneous data, all of the same type, and so it uses only sizeof(one object) * length bytes of memory.  Mostly, you should use it when you need to expose a C array to an extension or a system call (for example, ioctl or fctnl).  It's also a good way to represent a mutable string (array('B', bytes)) until that actually becomes available in Python 3.0.
However, if you want to do math on a homogeneous array of numeric data, then you're much better off using NumPy, which can automatically vectorize operations on complex multi-dimensional arrays.
To make a long story short: array.array is useful when you need a homogeneous C array of data for reasons other than doing math.
 </s>