New submission from Jonathan Booth:

https://docs.python.org/3.5/library/array.html describes the 'I' and 'i' 
typecodes as being minimum-size in bytes of 2. The interpreter disagrees:

>>> import array
>>> a = array.array('i')
>>> a.itemsize
4

There is also a bug with the 'L' and 'l' long typecodes, which document as 
min-size of 4 bytes but are 8 bytes in the interpreter. That could be a bug in 
cPython itself though, as if 'L' should be 8 bytes, that disagrees with the 
type code sizing from the struct module, where it is 4 bytes, just like 
integers.

I checked documentation for all versions of python and it matches -- I did not 
check all python interpreters to see they match, but 2.7 and 3.5 did.

----------
assignee: docs@python
components: Documentation
messages: 263931
nosy: Jonathan Booth, docs@python
priority: normal
severity: normal
status: open
title: array module "minimum size in bytes" table is wrong for int/long
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue26821>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to