Built-in module array

This module defines a new object type which can efficiently represent an array of basic values: characters, integers, floating point numbers. Arrays are sequence types and behave very much like lists, except that the type of objects stored in them is constrained. The type is specified at object creation time by using a type code, which is a single character. The following type codes are defined:


#tableiii1316#

The actual representation of values is determined by the machine architecture (strictly spoken, by the C implementation). The actual size can be accessed through the typecode attribute.

The module defines the following function:


#funcdesc1347#

Array objects support the following data items and methods:


#datadesc1355#


#datadesc1358#


#funcdesc1361#


#funcdesc1366#


#funcdesc1370#


#funcdesc1378#


#funcdesc1383#


#funcdesc1388#


#funcdesc1394#


#funcdesc1399#


#funcdesc1403#

When an array object is printed or converted to a string, it is represented as array(typecode, initializer). The initializer is omitted if the array is empty, otherwise it is a string if the typecode is 'c', otherwise it is a list of numbers. The string is guaranteed to be able to be converted back to an array with the same type and value using reverse quotes (``). Examples:

verbatim160#