File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,16 +12,23 @@ \section{Built-in Module \sectcode{array}}
1212\begin {tableiii }{|c|c|c|}{code}{Typecode}{Type}{Minimal size in bytes}
1313\lineiii {'c'}{character}{1}
1414\lineiii {'b'}{signed integer}{1}
15+ \lineiii {'B'}{unsigned integer}{1}
1516\lineiii {'h'}{signed integer}{2}
17+ \lineiii {'H'}{unsigned integer}{2}
1618\lineiii {'i'}{signed integer}{2}
19+ \lineiii {'I'}{unsigned integer}{2}
1720\lineiii {'l'}{signed integer}{4}
21+ \lineiii {'L'}{unsigned integer}{4}
1822\lineiii {'f'}{floating point}{4}
1923\lineiii {'d'}{floating point}{8}
2024\end {tableiii }
2125
2226The actual representation of values is determined by the machine
2327architecture (strictly speaking, by the C implementation). The actual
24- size can be accessed through the \var {itemsize} attribute.
28+ size can be accessed through the \var {itemsize} attribute. The values
29+ stored for \code {'L'} and \code {'I'} items will be represented as
30+ Python long integers when retrieved, because Python's plain integer
31+ type can't represent the full range of C's unsigned (long) integers.
2532
2633See also built-in module \code {struct}.
2734\bimodindex {struct}
Original file line number Diff line number Diff line change @@ -12,16 +12,23 @@ \section{Built-in Module \sectcode{array}}
1212\begin {tableiii }{|c|c|c|}{code}{Typecode}{Type}{Minimal size in bytes}
1313\lineiii {'c'}{character}{1}
1414\lineiii {'b'}{signed integer}{1}
15+ \lineiii {'B'}{unsigned integer}{1}
1516\lineiii {'h'}{signed integer}{2}
17+ \lineiii {'H'}{unsigned integer}{2}
1618\lineiii {'i'}{signed integer}{2}
19+ \lineiii {'I'}{unsigned integer}{2}
1720\lineiii {'l'}{signed integer}{4}
21+ \lineiii {'L'}{unsigned integer}{4}
1822\lineiii {'f'}{floating point}{4}
1923\lineiii {'d'}{floating point}{8}
2024\end {tableiii }
2125
2226The actual representation of values is determined by the machine
2327architecture (strictly speaking, by the C implementation). The actual
24- size can be accessed through the \var {itemsize} attribute.
28+ size can be accessed through the \var {itemsize} attribute. The values
29+ stored for \code {'L'} and \code {'I'} items will be represented as
30+ Python long integers when retrieved, because Python's plain integer
31+ type can't represent the full range of C's unsigned (long) integers.
2532
2633See also built-in module \code {struct}.
2734\bimodindex {struct}
You can’t perform that action at this time.
0 commit comments