Skip to content

gh-110383: Added explanation in Doc about array data types range. Based on GNU docs #113708

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions Doc/library/array.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@ defined:
+-----------+--------------------+-------------------+-----------------------+-------+
| ``'H'`` | unsigned short | int | 2 | |
+-----------+--------------------+-------------------+-----------------------+-------+
| ``'i'`` | signed int | int | 2 | |
| ``'i'`` | signed int | int | 2 | \(2) |
+-----------+--------------------+-------------------+-----------------------+-------+
| ``'I'`` | unsigned int | int | 2 | |
| ``'I'`` | unsigned int | int | 2 | \(2) |
+-----------+--------------------+-------------------+-----------------------+-------+
| ``'l'`` | signed long | int | 4 | |
| ``'l'`` | signed long | int | 4 | \(2) |
+-----------+--------------------+-------------------+-----------------------+-------+
| ``'L'`` | unsigned long | int | 4 | |
| ``'L'`` | unsigned long | int | 4 | \(2) |
+-----------+--------------------+-------------------+-----------------------+-------+
| ``'q'`` | signed long long | int | 8 | |
| ``'q'`` | signed long long | int | 8 | \(2) |
+-----------+--------------------+-------------------+-----------------------+-------+
| ``'Q'`` | unsigned long long | int | 8 | |
| ``'Q'`` | unsigned long long | int | 8 | \(2) |
+-----------+--------------------+-------------------+-----------------------+-------+
| ``'f'`` | float | float | 4 | |
+-----------+--------------------+-------------------+-----------------------+-------+
Expand All @@ -60,6 +60,13 @@ Notes:
.. deprecated-removed:: 3.3 3.16
Please migrate to ``'w'`` typecode.

(2)
Int data types (signed or unsigned) can be 16 or 32 bits depending on the platform. The
same way that long data types can be 32 or 64 bits depending on the platform. On most
machines that run GNU C Library, an int is a 32-bit quantity. On most machines, long
int is also 32-bit, the same size as int. And lastly, on most machines, long long int
are 64-bit quantities. View more at: https://www.gnu.org/software/libc/manual/html_node/Range-of-Type.html


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