O'Reilly logo

Python: Essential Reference, Third Edition by David Beazley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

array

The array module defines a new object type, array, that works almost exactly like other sequence types, except that its contents are constrained to a single type. The type of an array is determined at the time of creation, using one of the following type codes:

Type CodeDescriptionC TypeMinimum Size (in Bytes)
‘c’8-bit characterchar1
‘b’8-bit integersigned char1
‘B’8-bit unsigned integerunsigned char1
‘u’Unicode characterPY_UNICODE2 or 4
‘h’16-bit integershort2
‘H’16-bit unsigned integerunsigned short2
‘i’Integerint4 or 8
‘I’Unsigned integerunsigned int4 or 8
‘l’Long integerlong4 or 8
‘L’Unsigned long integerunsigned long4 or 8
‘f’Single-precision floatfloat4
‘d’Double-precision floatdouble8

The representation of integers and long integers is determined ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required