May 2017
Intermediate to advanced
310 pages
8h 5m
English
The array module defines a datatype array that is similar to the list datatype except for the constraint that their contents must be of a single type of the underlying representation, as is determined by the machine architecture or underlying C implementation.
The type of an array is determined at creation time and it is indicated by one of the following type codes:
|
Code |
C type |
Python type |
Minimum bytes |
|
'b' |
signed char |
int |
1 |
|
'B' |
unsigned char |
int |
1 |
|
'u' |
Py_UNICODE |
Unicode character |
2 |
|
'h' |
signed short |
int |
2 |
|
'H' |
unsigned short |
int |
2 |
|
'i' |
signed int |
int |
2 |
|
'I' |
unsigned int |
int |
2 |
|
'l' |
signed long |
int |
4 |
|
'L' |
unsigned long |
int |
8 |
|
'q' |
signed ... |