Uh oh!
There was an error while loading. Please reload this page.
gh-110383: Added explanation in Doc about array data types range. Based on GNU docs - #113708
gh-110383: Added explanation in Doc about array data types range. Based on GNU docs#113708LombardiDaniel wants to merge 5 commits into
Conversation
array -- data type sizes based on GNU documentation Signed-off-by: Daniel Lombardi <lombardi.daniel.o@gmail.com>
LombardiDaniel
commented
Jan 4, 2024
Can check altered docs at: library/array.html#module-array |
Signed-off-by: Daniel Lombardi <lombardi.daniel.o@gmail.com>
serhiy-storchaka
commented
Jan 26, 2024
Isn't it outdated? I am not sure that on most machines that run Python |
ronaldoussoren
commented
Jan 26, 2024
Yes. See also my comment above. The proposed text is not correct in several ways:
Other than that I don't understand why adding these notes is helpful for users, these notes don't add anything that I (as a user) can use. |
serhiy-storchaka
commented
Jan 26, 2024
Eh. I do no see any other your comment. I agree that this change is perhaps not very useful. |
| (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 | ||
There was a problem hiding this comment.
IMHO "on most machines ..." doesn't really add anything.
In practice most general purpose machines are one of:
- 32-bit CPUs: int, long are 32 bit, long long is 64 bit
- 64-bit CPUs running Windows: int, long are 32-bit, long long is 64-bit
- 64-bit CPUs running Unix-y systems (including Linux and macOS): int is 32-bit, long and long long are 64-bit
There are exceptions to this, but AFAIK most of those are special CPUs like DSPs or are from before the existence of C. Neither of which are useful to mention here.
ronaldoussoren
commented
Jan 27, 2024
You should now, apparently it is important to actually post comments 🤦. That also explains why nobody reacted to my comment...
|
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
| Please migrate to ``'w'`` typecode. | ||
| (2) | ||
| As of 2024, 'h', 'i', 'l', and 'q' are usually 2, 4, 4 on Windows else 8, and 8 bytes. |
There was a problem hiding this comment.
This note talks about h, so if it's kept, the \(2) should be added to the h & H lines in the table.
But, maybe this PR should be closed without merging. If you're wrinting cross-platform code you shouldn't rely on “common” values; if not you can use itemsize to find values that are actually right for your platform.
terryjreedy
commented
May 30, 2024
I have no more opinions on this. Do whatever. |
array -- data type sizes based on GNU documentation: https://www.gnu.org/software/libc/manual/html_node/Range-of-Type.html
📚 Documentation preview 📚: https://cpython-previews--113708.org.readthedocs.build/