Skip to content
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

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

LombardiDaniel
Copy link

@LombardiDaniel LombardiDaniel commented Jan 4, 2024

array -- data type sizes based on GNU documentation

Signed-off-by: Daniel Lombardi <lombardi.daniel.o@gmail.com>
Copy link

cpython-cla-bot bot commented Jan 4, 2024

All commit authors signed the Contributor License Agreement.
CLA signed

@bedevere-app bedevere-app bot added docs Documentation in the Doc dir skip news awaiting review labels Jan 4, 2024
@LombardiDaniel
Copy link
Author

Can check altered docs at: library/array.html#module-array

@serhiy-storchaka
Copy link
Member

Isn't it outdated? I am not sure that on most machines that run Python long is 32-bit.

@ronaldoussoren
Copy link
Contributor

Isn't it outdated? I am not sure that on most machines that run Python long is 32-bit.

Yes. See also my comment above. The proposed text is not correct in several ways:

  • The reference to GNU Libc is incorrect, size of the various types depends on the C ABI for particular platforms
  • On most platforms "long" is either 32-bit (32-bit CPUs and Windows) or 64-bit (64-bit CPUs except Windows)

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
Copy link
Member

Eh. I do no see any other your comment.

I agree that this change is perhaps not very useful.

Comment on lines 63 to 69
(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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Contributor

Eh. I do no see any other your comment.

You should now, apparently it is important to actually post comments 🤦. That also explains why nobody reacted to my comment...

I agree that this change is perhaps not very useful.

Doc/library/array.rst Outdated Show resolved Hide resolved
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting review docs Documentation in the Doc dir skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants