[Python-Dev] Replacement for array.array('u')? (original) (raw)

Greg Ewing greg.ewing at canterbury.ac.nz
Fri Mar 22 20:19:01 EDT 2019


Antoine Pitrou wrote:

TBH, I think anyone trying to use array.array should be directed to Numpy these days. The only reason for array.array being here is that it predates Numpy.

Numpy is a huge dependency to pull in when you don't need all the heavyweight array machinery.

Also, numpy arrays behave very differently from Python sequences in many ways. For example, they don't have a flexible size, and you can't concatenate them using +.

Arrays from the array module follow the sequence protocol much more closely, and that makes them valuable, IMO.

-- Greg



More information about the Python-Dev mailing list