Re: array.itemsize: Documentation Versus Reality

2016-09-17 Thread eryk sun
On Sun, Sep 18, 2016 at 3:55 AM, Chris Angelico wrote: > On Sun, Sep 18, 2016 at 1:16 PM, Lawrence D’Oliveiro > wrote: >> On Sunday, September 18, 2016 at 2:34:46 PM UTC+12, eryk sun wrote: >>> However, I see that MicroPython [1] has been ported to

Re: array.itemsize: Documentation Versus Reality

2016-09-17 Thread Chris Angelico
On Sun, Sep 18, 2016 at 1:16 PM, Lawrence D’Oliveiro wrote: > On Sunday, September 18, 2016 at 2:34:46 PM UTC+12, eryk sun wrote: >> However, I see that MicroPython [1] has been ported to 16-bit >> PIC microcontrollers. An int should be 16-bit in that case. >> >> [1]:

Re: array.itemsize: Documentation Versus Reality

2016-09-17 Thread Lawrence D’Oliveiro
On Sunday, September 18, 2016 at 2:34:46 PM UTC+12, eryk sun wrote: > 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 From the readme: “MicroPython implements the

Re: array.itemsize: Documentation Versus Reality

2016-09-17 Thread eryk sun
On Sun, Sep 18, 2016 at 12:17 AM, Lawrence D’Oliveiro 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

Re: array.itemsize: Documentation Versus Reality

2016-09-17 Thread Lawrence D’Oliveiro
On Saturday, September 17, 2016 at 3:47:15 PM UTC+12, I wrote: > >>> a = array.array("I", (0,)) > >>> a.itemsize > 4 > >>> a = array.array("L", (0,)) > >>> a.itemsize > 8 Let me rephrase the question. It seems clear that “l”

Re: array.itemsize: Documentation Versus Reality

2016-09-17 Thread Lawrence D’Oliveiro
On Saturday, September 17, 2016 at 11:54:10 PM UTC+12, Christian Heimes wrote: > > ... on Windows (32 and 64bit), a long is always 32bit and an array with > datatype "L" has itemsize 4. Ah, I forgot the LLP64 nonsense... -- https://mail.python.org/mailman/listinfo/python-list

Re: array.itemsize: Documentation Versus Reality

2016-09-17 Thread Christian Heimes
On 2016-09-17 05:47, Lawrence D’Oliveiro wrote: > >>> a = array.array("I", (0,)) > >>> a.itemsize > 4 > >>> a = array.array("L", (0,)) > >>> a.itemsize > 8 > > According to , the “minimum > size” should be 2 and 4

array.itemsize: Documentation Versus Reality

2016-09-16 Thread Lawrence D’Oliveiro
>>> a = array.array("I", (0,)) >>> a.itemsize 4 >>> a = array.array("L", (0,)) >>> a.itemsize 8 According to , the “minimum size” should be 2 and 4 respectively. It further says: The actual representation of values is