array.itemsize: Documentation Versus Reality

Lawrence D’Oliveiro lawrencedo99 at gmail.com
Fri Sep 16 23:47:05 EDT 2016


    >>> a = array.array("I", (0,))
    >>> a.itemsize
    4
    >>> a = array.array("L", (0,))
    >>> a.itemsize
    8

According to <https://docs.python.org/3/library/array.html>, the “minimum size” should be 2 and 4 respectively. It further says:

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

Are there any C compilers still in common use where the values will not be 4 and 8, as above?



More information about the Python-list mailing list