array.itemsize: Documentation Versus Reality

eryk sun eryksun at gmail.com
Sat Sep 17 22:33:27 EDT 2016


On Sun, Sep 18, 2016 at 12:17 AM, Lawrence D’Oliveiro
<lawrencedo99 at gmail.com> wrote:
>
> why does the documentation suggest that “i” and “I” could have an item size of 2?

SHRT_MAX <= INT_MAX <= LONG_MAX <= LLONG_MAX. short int and int  ("h"
and "i") are at least 16-bit. long int ("l") is at least 32-bit. long
long int ("q") is at least 64-bit.

AFAIK, however, an int is 32-bit on all platforms supported by
CPython. However, I see that MicroPython [1] has been ported to 16-bit
PIC microcontrollers. An int should be 16-bit in that case.

[1]: https://github.com/micropython/micropython



More information about the Python-list mailing list