Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-121485: Always use 64-bit integers for integers bits count#121486

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
serhiy-storchaka merged 13 commits intopython:mainfromserhiy-storchaka:int64-bits
Aug 30, 2024

Conversation

@serhiy-storchaka
Copy link
Member

@serhiy-storchakaserhiy-storchaka commentedJul 8, 2024
edited by bedevere-appbot
Loading

Use 64-bit integers instead of platform specific size_t or Py_ssize_t to represent the number of bits in Python integer.

gpshead reacted with thumbs up emoji
Use 64-bit integers instead of platform specific size_t or Py_ssize_tto represent the number of bits in Python integer.
Copy link
Member

@mdickinsonmdickinson left a comment

Choose a reason for hiding this comment

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

Definitely +1 for the idea. I'm afraid I won't have bandwidth for a detailed code review in the near future.

@serhiy-storchaka
Copy link
MemberAuthor

And what do you think about imposing a hard limit on Python integers, so integers larger than$2^{2^{63}-1}-1$ or$2^{2^{64}-1}-1$ could not even be created? Then the number of bits can always be expressed as a 64-bit integer, error checks after_PyLong_NumBits and_PyLong_Frexp can be removed, and the code for shift operations andint.bit_count() significantly simplified.

@serhiy-storchaka
Copy link
MemberAuthor

I can update this PR for the later idea or implement it in a separate issue.

@mdickinson
Copy link
Member

And what do you think about imposing a hard limit on Python integers ...

That sounds totally reasonable to me (presumably as a CPython detail, rather than an aspect of Python-the-language). Any future computing landscape that makes operating on ints of that size remotely feasible is going to lookvery different from today's landscape.

gpshead reacted with thumbs up emoji

@rhettingerrhettinger removed their request for reviewJuly 15, 2024 03:18
@serhiy-storchaka
Copy link
MemberAuthor

Thanks,@gpshead.

gpshead reacted with thumbs up emoji

@serhiy-storchakaserhiy-storchaka merged commit32c7dbb intopython:mainAug 30, 2024
@serhiy-storchakaserhiy-storchaka deleted the int64-bits branchAugust 30, 2024 05:13
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@isidenticalisidenticalAwaiting requested review from isidentical

1 more reviewer

@mdickinsonmdickinsonmdickinson left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@serhiy-storchaka@mdickinson@blhsing@gpshead

[8]ページ先頭

©2009-2025 Movatter.jp