René's URL Explorer Experiment


Title: bpo-29782: Consolidate _Py_Bit_Length() by niklasf · Pull Request #20739 · python/cpython · GitHub

Open Graph Title: bpo-29782: Consolidate _Py_Bit_Length() by niklasf · Pull Request #20739 · python/cpython

X Title: bpo-29782: Consolidate _Py_Bit_Length() by niklasf · Pull Request #20739 · python/cpython

Description: The Python programming language. Contribute to python/cpython development by creating an account on GitHub.

Open Graph Description: In GH-2866, _Py_Bit_Length() was added to pymath.h for lack of a better location. GH-20518 added a more appropriate header file for bit utilities. It also shows how to properly use intrinsics. This...

X Description: In GH-2866, _Py_Bit_Length() was added to pymath.h for lack of a better location. GH-20518 added a more appropriate header file for bit utilities. It also shows how to properly use intrinsics. This...

Opengraph URL: https://github.com/python/cpython/pull/20739

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/commits(.:format)
route-controllerpull_requests
route-actioncommits
fetch-noncev2:8f76e816-71b8-fbe4-8156-365b58f28ad8
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id8DCA:327857:117F9B7:18128A8:696A8DDF
html-safe-nonce53c0adb7c934bfd3ea4584551d41ce0979006209439dcadd137e9512026ea815
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RENBOjMyNzg1NzoxMTdGOUI3OjE4MTI4QTg6Njk2QThEREYiLCJ2aXNpdG9yX2lkIjoiNDU0MjcxOTc5MzI5Mzg1NjIyMyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmace07088359aec3bb12004cca417dd0705236e8ad5ac76b8ae75c89b1c3e9b8d15
hovercard-subject-tagpull_request:431307468
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/commits
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/python/cpython/pull/20739/commits
twitter:imagehttps://opengraph.githubassets.com/ca5fbc6f38e3216b26ca4eefa4f6b568eb6fa7150a5adcd36ee4121a5afa08e5/python/cpython/pull/20739
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/ca5fbc6f38e3216b26ca4eefa4f6b568eb6fa7150a5adcd36ee4121a5afa08e5/python/cpython/pull/20739
og:image:altIn GH-2866, _Py_Bit_Length() was added to pymath.h for lack of a better location. GH-20518 added a more appropriate header file for bit utilities. It also shows how to properly use intrinsics. This...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameniklasf
hostnamegithub.com
expected-hostnamegithub.com
Noned2aa6dedd7d97fa651b17c40401f2605f309df5ca5fb659bf0554cf34f1de825
turbo-cache-controlno-cache
go-importgithub.com/python/cpython git https://github.com/python/cpython.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id81598961
octolytics-dimension-repository_nwopython/cpython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id81598961
octolytics-dimension-repository_network_root_nwopython/cpython
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasec1dbca8981c5e3d6a69bce2f1d289e732b86241d
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/pull/20739/commits#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F20739%2Fcommits
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F20739%2Fcommits
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Fcommits&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/pull/20739/commits
Reloadhttps://github.com/python/cpython/pull/20739/commits
Reloadhttps://github.com/python/cpython/pull/20739/commits
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/pull/20739/commits
Notifications https://github.com/login?return_to=%2Fpython%2Fcpython
Fork 33.9k https://github.com/login?return_to=%2Fpython%2Fcpython
Star 71.1k https://github.com/login?return_to=%2Fpython%2Fcpython
Code https://github.com/python/cpython
Issues 5k+ https://github.com/python/cpython/issues
Pull requests 2.1k https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects 31 https://github.com/python/cpython/projects
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/python/cpython/security
Please reload this pagehttps://github.com/python/cpython/pull/20739/commits
Insights https://github.com/python/cpython/pulse
Code https://github.com/python/cpython
Issues https://github.com/python/cpython/issues
Pull requests https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects https://github.com/python/cpython/projects
Security https://github.com/python/cpython/security
Insights https://github.com/python/cpython/pulse
vstinnerhttps://github.com/vstinner
python:masterhttps://github.com/python/cpython/tree/master
niklasf:bpo-29782-msbhttps://github.com/niklasf/cpython/tree/bpo-29782-msb
Conversationhttps://github.com/python/cpython/pull/20739
Commits21 (21)https://github.com/python/cpython/pull/20739/commits
Checkshttps://github.com/python/cpython/pull/20739/checks
Files changedhttps://github.com/python/cpython/pull/20739/files
bpo-29782: Consolidate _Py_Bit_Length()https://github.com/python/cpython/pull/20739/commits#top
vstinnerhttps://github.com/vstinner
python:masterhttps://github.com/python/cpython/tree/master
niklasf:bpo-29782-msbhttps://github.com/niklasf/cpython/tree/bpo-29782-msb
bpo-29782: Consolidate _Py_Bit_Length()https://github.com/python/cpython/pull/20739/commits/281009cad94119a78b73302f2b0c3be216f6b26c
https://github.com/niklasf
niklasfhttps://github.com/python/cpython/commits?author=niklasf
281009chttps://github.com/python/cpython/pull/20739/commits/281009cad94119a78b73302f2b0c3be216f6b26c
https://github.com/python/cpython/tree/281009cad94119a78b73302f2b0c3be216f6b26c
Specify required gcc version for __builtin_clzlhttps://github.com/python/cpython/pull/20739/commits/65abb8304d41c82efee2f64f2a0d126ed7e3013b
https://github.com/niklasf
niklasfhttps://github.com/python/cpython/commits?author=niklasf
65abb83https://github.com/python/cpython/pull/20739/commits/65abb8304d41c82efee2f64f2a0d126ed7e3013b
https://github.com/python/cpython/tree/65abb8304d41c82efee2f64f2a0d126ed7e3013b
Fix _BitScanReverse usagehttps://github.com/python/cpython/pull/20739/commits/ce45ff2a8d0a131839942dd78fa0952ccff42bae
https://github.com/niklasf
niklasfhttps://github.com/python/cpython/commits?author=niklasf
ce45ff2https://github.com/python/cpython/pull/20739/commits/ce45ff2a8d0a131839942dd78fa0952ccff42bae
https://github.com/python/cpython/tree/ce45ff2a8d0a131839942dd78fa0952ccff42bae
Document reason for includehttps://github.com/python/cpython/pull/20739/commits/6464ca6001409512ea15c7d4ea732b4b84a96dfa
https://github.com/niklasf
niklasfhttps://github.com/python/cpython/commits?author=niklasf
6464ca6https://github.com/python/cpython/pull/20739/commits/6464ca6001409512ea15c7d4ea732b4b84a96dfa
https://github.com/python/cpython/tree/6464ca6001409512ea15c7d4ea732b4b84a96dfa
Ensure future compatibilityhttps://github.com/python/cpython/pull/20739/commits/0bd42652dfed7b06dc0fe9e6732e327b717f1618
https://github.com/niklasf
niklasfhttps://github.com/python/cpython/commits?author=niklasf
0bd4265https://github.com/python/cpython/pull/20739/commits/0bd42652dfed7b06dc0fe9e6732e327b717f1618
https://github.com/python/cpython/tree/0bd42652dfed7b06dc0fe9e6732e327b717f1618
Do not try to support GCC < 3.4https://github.com/python/cpython/pull/20739/commits/fbaca66885fdfb64edcbe5ec45ec590405e98e79
https://github.com/niklasf
niklasfhttps://github.com/python/cpython/commits?author=niklasf
fbaca66https://github.com/python/cpython/pull/20739/commits/fbaca66885fdfb64edcbe5ec45ec590405e98e79
https://github.com/python/cpython/tree/fbaca66885fdfb64edcbe5ec45ec590405e98e79
Coding stylehttps://github.com/python/cpython/pull/20739/commits/436f68b26f776a5fd80375122c44c00c9710dd70
https://github.com/niklasf
niklasfhttps://github.com/python/cpython/commits?author=niklasf
436f68bhttps://github.com/python/cpython/pull/20739/commits/436f68b26f776a5fd80375122c44c00c9710dd70
https://github.com/python/cpython/tree/436f68b26f776a5fd80375122c44c00c9710dd70
Fix comment indenthttps://github.com/python/cpython/pull/20739/commits/ac664bc555efa89e309e1bfcfd51243ccb055205
niklasfhttps://github.com/python/cpython/commits?author=niklasf
vstinnerhttps://github.com/python/cpython/commits?author=vstinner
ac664bchttps://github.com/python/cpython/pull/20739/commits/ac664bc555efa89e309e1bfcfd51243ccb055205
https://github.com/python/cpython/tree/ac664bc555efa89e309e1bfcfd51243ccb055205
Do not factor out x != 0https://github.com/python/cpython/pull/20739/commits/3279d1750e25d7589e6f2d92391578ab41d613cb
https://github.com/niklasf
niklasfhttps://github.com/python/cpython/commits?author=niklasf
3279d17https://github.com/python/cpython/pull/20739/commits/3279d1750e25d7589e6f2d92391578ab41d613cb
https://github.com/python/cpython/tree/3279d1750e25d7589e6f2d92391578ab41d613cb
Fix and move _Py_bit_length_digit()https://github.com/python/cpython/pull/20739/commits/525da3d1f77d0b34a81ad18a32cbf65f3b677eb8
https://github.com/niklasf
niklasfhttps://github.com/python/cpython/commits?author=niklasf
525da3dhttps://github.com/python/cpython/pull/20739/commits/525da3d1f77d0b34a81ad18a32cbf65f3b677eb8
https://github.com/python/cpython/tree/525da3d1f77d0b34a81ad18a32cbf65f3b677eb8
Add unit test for _Py_bit_length()https://github.com/python/cpython/pull/20739/commits/e4876228c203758ee3e512c0dbfe04019901dd9a
https://github.com/niklasf
niklasfhttps://github.com/python/cpython/commits?author=niklasf
e487622https://github.com/python/cpython/pull/20739/commits/e4876228c203758ee3e512c0dbfe04019901dd9a
https://github.com/python/cpython/tree/e4876228c203758ee3e512c0dbfe04019901dd9a
Remove useless cast in testhttps://github.com/python/cpython/pull/20739/commits/a338761dd9d47dec671b1711c526cca551fb2ad5
https://github.com/niklasf
niklasfhttps://github.com/python/cpython/commits?author=niklasf
a338761https://github.com/python/cpython/pull/20739/commits/a338761dd9d47dec671b1711c526cca551fb2ad5
https://github.com/python/cpython/tree/a338761dd9d47dec671b1711c526cca551fb2ad5
Use original implementation as fallbackhttps://github.com/python/cpython/pull/20739/commits/5a146f7cc3b4377d188463f4134b77524d7c9d39
https://github.com/niklasf
niklasfhttps://github.com/python/cpython/commits?author=niklasf
5a146f7https://github.com/python/cpython/pull/20739/commits/5a146f7cc3b4377d188463f4134b77524d7c9d39
https://github.com/python/cpython/tree/5a146f7cc3b4377d188463f4134b77524d7c9d39
Re-enable intrinsicshttps://github.com/python/cpython/pull/20739/commits/8e3ce6615c0f053c5e0186423e59ecfc041095e2
https://github.com/niklasf
niklasfhttps://github.com/python/cpython/commits?author=niklasf
8e3ce66https://github.com/python/cpython/pull/20739/commits/8e3ce6615c0f053c5e0186423e59ecfc041095e2
https://github.com/python/cpython/tree/8e3ce6615c0f053c5e0186423e59ecfc041095e2
Explicitly cast sizeofhttps://github.com/python/cpython/pull/20739/commits/86241f6ecb36e07ba76fc8c1162d76ab3c0e6ac4
niklasfhttps://github.com/python/cpython/commits?author=niklasf
vstinnerhttps://github.com/python/cpython/commits?author=vstinner
86241f6https://github.com/python/cpython/pull/20739/commits/86241f6ecb36e07ba76fc8c1162d76ab3c0e6ac4
https://github.com/python/cpython/tree/86241f6ecb36e07ba76fc8c1162d76ab3c0e6ac4
Better testshttps://github.com/python/cpython/pull/20739/commits/c7ccbe206269a79fc73c7ab1bfe3183e2a21fc62
niklasfhttps://github.com/python/cpython/commits?author=niklasf
vstinnerhttps://github.com/python/cpython/commits?author=vstinner
c7ccbe2https://github.com/python/cpython/pull/20739/commits/c7ccbe206269a79fc73c7ab1bfe3183e2a21fc62
https://github.com/python/cpython/tree/c7ccbe206269a79fc73c7ab1bfe3183e2a21fc62
Explain Py_BUILD_ASSERT(sizeof(unsigned long) <= 4)https://github.com/python/cpython/pull/20739/commits/dfceaf205ed74b9a229cc92c53d7247ad7c5b9eb
https://github.com/niklasf
niklasfhttps://github.com/python/cpython/commits?author=niklasf
dfceaf2https://github.com/python/cpython/pull/20739/commits/dfceaf205ed74b9a229cc92c53d7247ad7c5b9eb
https://github.com/python/cpython/tree/dfceaf205ed74b9a229cc92c53d7247ad7c5b9eb
Use volatile so test actually runs intrinsichttps://github.com/python/cpython/pull/20739/commits/fbf01ae0c98156b3f9692453af6c739dedaf4f14
https://github.com/niklasf
niklasfhttps://github.com/python/cpython/commits?author=niklasf
fbf01aehttps://github.com/python/cpython/pull/20739/commits/fbf01ae0c98156b3f9692453af6c739dedaf4f14
https://github.com/python/cpython/tree/fbf01ae0c98156b3f9692453af6c739dedaf4f14
Remove trailing spaceshttps://github.com/python/cpython/pull/20739/commits/991622b6d5542b9d446aee609a4a70504b5c58a8
https://github.com/niklasf
niklasfhttps://github.com/python/cpython/commits?author=niklasf
991622bhttps://github.com/python/cpython/pull/20739/commits/991622b6d5542b9d446aee609a4a70504b5c58a8
https://github.com/python/cpython/tree/991622b6d5542b9d446aee609a4a70504b5c58a8
_Py_bit_length_digit -> bit_length_digithttps://github.com/python/cpython/pull/20739/commits/462d995f073215309cbd9afc1aa93658cf683777
https://github.com/niklasf
niklasfhttps://github.com/python/cpython/commits?author=niklasf
462d995https://github.com/python/cpython/pull/20739/commits/462d995f073215309cbd9afc1aa93658cf683777
https://github.com/python/cpython/tree/462d995f073215309cbd9afc1aa93658cf683777
Fixup test expectationshttps://github.com/python/cpython/pull/20739/commits/98fc7a867ede94c2ba2b2077c4deb0227dc8ce7f
https://github.com/niklasf
niklasfhttps://github.com/python/cpython/commits?author=niklasf
98fc7a8https://github.com/python/cpython/pull/20739/commits/98fc7a867ede94c2ba2b2077c4deb0227dc8ce7f
https://github.com/python/cpython/tree/98fc7a867ede94c2ba2b2077c4deb0227dc8ce7f
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.