René's URL Explorer Experiment


Title: GH-106008: Make implicit boolean conversions explicit by brandtbucher · Pull Request #106003 · python/cpython · GitHub

Open Graph Title: GH-106008: Make implicit boolean conversions explicit by brandtbucher · Pull Request #106003 · python/cpython

X Title: GH-106008: Make implicit boolean conversions explicit by brandtbucher · Pull Request #106003 · python/cpython

Description: ...and specialize them! This adds a new TO_BOOL bytecode that prefixes all UNARY_NOT, POP_JUMP_IF_TRUE, and POP_JUMP_IF_FALSE instructions, which now require an exact boolean. We also use a spare bit in COMPARE_OP's oparg to indicate whether the result should be converted to bool (this saves a TO_BOOL for most branches, and is a no-op for all COMPARE_OP specializations). "0% faster". Stats show a 93.5% hit rate for the new instructions. 📚 Documentation preview 📚: https://cpython-previews--106003.org.readthedocs.build/ Issue: gh-106008

Open Graph Description: ...and specialize them! This adds a new TO_BOOL bytecode that prefixes all UNARY_NOT, POP_JUMP_IF_TRUE, and POP_JUMP_IF_FALSE instructions, which now require an exact boolean. We also use a spare b...

X Description: ...and specialize them! This adds a new TO_BOOL bytecode that prefixes all UNARY_NOT, POP_JUMP_IF_TRUE, and POP_JUMP_IF_FALSE instructions, which now require an exact boolean. We also use a spare b...

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

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/commits/:range(.:format)
route-controllerpull_requests
route-actioncommits
fetch-noncev2:52ce0aa9-db1b-42ab-beca-4a2833442ce9
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idA206:1B8326:56E2F66:7509926:6995C1BE
html-safe-noncef1f7ddf2fae1b4b8fb0c3c0b60b7db4ab5ad11ef5f540ef390195de427670276
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMjA2OjFCODMyNjo1NkUyRjY2Ojc1MDk5MjY6Njk5NUMxQkUiLCJ2aXNpdG9yX2lkIjoiNDk0NzQ0OTE2MDE5MjYwNjY1NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac01fda3e640d4f362e00bd59135f0f11eb099785087345e8fea39a446fe1092aa
hovercard-subject-tagpull_request:1404313169
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/106003/commits/d31407825cac7b01443449db0636e6b1af6dbb5d
twitter:imagehttps://avatars.githubusercontent.com/u/40968415?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/40968415?s=400&v=4
og:image:alt...and specialize them! This adds a new TO_BOOL bytecode that prefixes all UNARY_NOT, POP_JUMP_IF_TRUE, and POP_JUMP_IF_FALSE instructions, which now require an exact boolean. We also use a spare b...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None0f7f0c08152b2fbe00b7a94c0999555da729903b87c8fcd49e22663191f98790
turbo-cache-controlno-preview
diff-viewunified
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 full-width
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release3d0b59e9687d50052add63b746d8fab1d277b58a
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/pull/106003/commits/d31407825cac7b01443449db0636e6b1af6dbb5d#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F106003%2Fcommits%2Fd31407825cac7b01443449db0636e6b1af6dbb5d
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%2F106003%2Fcommits%2Fd31407825cac7b01443449db0636e6b1af6dbb5d
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/106003/commits/d31407825cac7b01443449db0636e6b1af6dbb5d
Reloadhttps://github.com/python/cpython/pull/106003/commits/d31407825cac7b01443449db0636e6b1af6dbb5d
Reloadhttps://github.com/python/cpython/pull/106003/commits/d31407825cac7b01443449db0636e6b1af6dbb5d
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/pull/106003/commits/d31407825cac7b01443449db0636e6b1af6dbb5d
Notifications https://github.com/login?return_to=%2Fpython%2Fcpython
Fork 34.1k https://github.com/login?return_to=%2Fpython%2Fcpython
Star 71.5k 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 0 https://github.com/python/cpython/security
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
Sign up for GitHub https://github.com/signup?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose
brandtbucherhttps://github.com/brandtbucher
python:mainhttps://github.com/python/cpython/tree/main
brandtbucher:to-boolhttps://github.com/brandtbucher/cpython/tree/to-bool
Conversation 16 https://github.com/python/cpython/pull/106003
Commits 18 https://github.com/python/cpython/pull/106003/commits
Checks 0 https://github.com/python/cpython/pull/106003/checks
Files changed https://github.com/python/cpython/pull/106003/files
Please reload this pagehttps://github.com/python/cpython/pull/106003/commits/d31407825cac7b01443449db0636e6b1af6dbb5d
GH-106008: Make implicit boolean conversions explicit https://github.com/python/cpython/pull/106003/commits/d31407825cac7b01443449db0636e6b1af6dbb5d#top
Show all changes 18 commits https://github.com/python/cpython/pull/106003/files
69781b4 Make boolean conversions in branches explicit brandtbucher Jun 6, 2023 https://github.com/python/cpython/pull/106003/commits/69781b4244a9485837b5eda473533e5c280068c0
5289c7f Specialize UNARY_NOT brandtbucher Jun 6, 2023 https://github.com/python/cpython/pull/106003/commits/5289c7f69e7e2ba75cafa076da55dd9f179cae7c
7e5c9df Remove unused stats brandtbucher Jun 7, 2023 https://github.com/python/cpython/pull/106003/commits/7e5c9df329695174378971dfe106e73ad368455a
27bb264 Make UNARY_NOT_BOOL a little bit slicker brandtbucher Jun 7, 2023 https://github.com/python/cpython/pull/106003/commits/27bb264e8247af28f554ea620389191fb7e78bbe
0463633 Replace UNARY_NOT with TO_BOOL brandtbucher Jun 9, 2023 https://github.com/python/cpython/pull/106003/commits/0463633b0f9583ad7aa322af4e9c0228949eed20
d2932a1 Catch up with main brandtbucher Jun 21, 2023 https://github.com/python/cpython/pull/106003/commits/d2932a1104df74a415b06fbcd85e9dc58f9413f7
47ec38f Branchless branching brandtbucher Jun 21, 2023 https://github.com/python/cpython/pull/106003/commits/47ec38f00f9a153473b19013cf71261550bbbe6a
a0bd53a Add a "boolean conversion" bit to COMPARE_OP brandtbucher Jun 21, 2023 https://github.com/python/cpython/pull/106003/commits/a0bd53a31edc9594e561b076b9bb23f3ae0be949
bab539b More stats for heap types brandtbucher Jun 21, 2023 https://github.com/python/cpython/pull/106003/commits/bab539bf50f769912c96f51ae427d4bac122e5d4
757b1cc Specialize TO_BOOL_ALWAYS_TRUE brandtbucher Jun 21, 2023 https://github.com/python/cpython/pull/106003/commits/757b1ccf830e46f7ee68e7e2e2c12869d81fc81c
f9fa498 Fix refleak and error handling brandtbucher Jun 21, 2023 https://github.com/python/cpython/pull/106003/commits/f9fa498686bbcb7e1b98a1e2769c5b1d37f26e9a
0c14344 Catch up with main brandtbucher Jun 22, 2023 https://github.com/python/cpython/pull/106003/commits/0c14344e7e746dae65e09061fcb52051dcd1c9bd
d314078 Cleanup brandtbucher Jun 23, 2023 https://github.com/python/cpython/pull/106003/commits/d31407825cac7b01443449db0636e6b1af6dbb5d
9aa83b5 blurb add brandtbucher Jun 23, 2023 https://github.com/python/cpython/pull/106003/commits/9aa83b5ef2259f12203218710a1b9085e980f3b4
a76f11d Docs brandtbucher Jun 23, 2023 https://github.com/python/cpython/pull/106003/commits/a76f11dcceb1ba9d28e72d21f2a8eccf0fc16507
c2d4a33 Clean up some commnts brandtbucher Jun 23, 2023 https://github.com/python/cpython/pull/106003/commits/c2d4a33f51c200f3c70c3b4f84fd808ecd122b3b
7638b76 Add cast brandtbucher Jun 29, 2023 https://github.com/python/cpython/pull/106003/commits/7638b76e18d78fab6c5d91a997ad8e4f2d97d40d
6b4a598 Catch up with main brandtbucher Jun 29, 2023 https://github.com/python/cpython/pull/106003/commits/6b4a5986c06132ff279e132751a79cbcab3ffacd
Clear filters https://github.com/python/cpython/pull/106003/commits/d31407825cac7b01443449db0636e6b1af6dbb5d
Please reload this pagehttps://github.com/python/cpython/pull/106003/commits/d31407825cac7b01443449db0636e6b1af6dbb5d
Please reload this pagehttps://github.com/python/cpython/pull/106003/commits/d31407825cac7b01443449db0636e6b1af6dbb5d
.gitattributes https://github.com/python/cpython/pull/106003/commits/d31407825cac7b01443449db0636e6b1af6dbb5d#diff-618cd5b83d62060ba3d027e314a21ceaf75d36067ff820db126642944145393e
bytecodes.c https://github.com/python/cpython/pull/106003/commits/d31407825cac7b01443449db0636e6b1af6dbb5d#diff-729a985b0cb8b431cb291f1edb561bbbfea22e3f8c262451cd83328a0936a342
flowgraph.c https://github.com/python/cpython/pull/106003/commits/d31407825cac7b01443449db0636e6b1af6dbb5d#diff-3cbf15668c31488528b7ab0f903c674a0ecf550f4f53c1be6cf8cd965246c2a0
generated_cases.c.h https://github.com/python/cpython/pull/106003/commits/d31407825cac7b01443449db0636e6b1af6dbb5d#diff-4ef46fa654f95502e49a24f7dc8ee31a4cac9b3433fe9cd2b2d4dd78cfbad448
specialize.c https://github.com/python/cpython/pull/106003/commits/d31407825cac7b01443449db0636e6b1af6dbb5d#diff-22e653d878778ca28317261f7826545288d02fd9980cf485d0329f28a34993f2
Prev https://github.com/python/cpython/pull/106003/commits/0c14344e7e746dae65e09061fcb52051dcd1c9bd
Next https://github.com/python/cpython/pull/106003/commits/9aa83b5ef2259f12203218710a1b9085e980f3b4
Please reload this pagehttps://github.com/python/cpython/pull/106003/commits/d31407825cac7b01443449db0636e6b1af6dbb5d
https://github.com/brandtbucher
brandtbucherhttps://github.com/python/cpython/commits?author=brandtbucher
.gitattributeshttps://github.com/python/cpython/pull/106003/commits/d31407825cac7b01443449db0636e6b1af6dbb5d#diff-618cd5b83d62060ba3d027e314a21ceaf75d36067ff820db126642944145393e
View file https://github.com/brandtbucher/cpython/blob/d31407825cac7b01443449db0636e6b1af6dbb5d/.gitattributes
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/106003/commits/{{ revealButtonHref }}
https://github.com/python/cpython/pull/106003/commits/d31407825cac7b01443449db0636e6b1af6dbb5d#diff-618cd5b83d62060ba3d027e314a21ceaf75d36067ff820db126642944145393e
https://github.com/python/cpython/pull/106003/commits/d31407825cac7b01443449db0636e6b1af6dbb5d#diff-618cd5b83d62060ba3d027e314a21ceaf75d36067ff820db126642944145393e
https://github.com/python/cpython/blob/main/.github/CODEOWNERS#L222
Python/bytecodes.chttps://github.com/python/cpython/pull/106003/commits/d31407825cac7b01443449db0636e6b1af6dbb5d#diff-729a985b0cb8b431cb291f1edb561bbbfea22e3f8c262451cd83328a0936a342
View file https://github.com/brandtbucher/cpython/blob/d31407825cac7b01443449db0636e6b1af6dbb5d/Python/bytecodes.c
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/106003/commits/{{ revealButtonHref }}
https://github.com/python/cpython/pull/106003/commits/d31407825cac7b01443449db0636e6b1af6dbb5d#diff-729a985b0cb8b431cb291f1edb561bbbfea22e3f8c262451cd83328a0936a342
https://github.com/python/cpython/pull/106003/commits/d31407825cac7b01443449db0636e6b1af6dbb5d#diff-729a985b0cb8b431cb291f1edb561bbbfea22e3f8c262451cd83328a0936a342
https://github.com/python/cpython/pull/106003/commits/d31407825cac7b01443449db0636e6b1af6dbb5d#diff-729a985b0cb8b431cb291f1edb561bbbfea22e3f8c262451cd83328a0936a342
https://github.com/python/cpython/pull/106003/commits/d31407825cac7b01443449db0636e6b1af6dbb5d#diff-729a985b0cb8b431cb291f1edb561bbbfea22e3f8c262451cd83328a0936a342
https://github.com/python/cpython/pull/106003/commits/d31407825cac7b01443449db0636e6b1af6dbb5d#diff-729a985b0cb8b431cb291f1edb561bbbfea22e3f8c262451cd83328a0936a342
https://github.com/python/cpython/pull/106003/commits/d31407825cac7b01443449db0636e6b1af6dbb5d#diff-729a985b0cb8b431cb291f1edb561bbbfea22e3f8c262451cd83328a0936a342
https://github.com/python/cpython/pull/106003/commits/d31407825cac7b01443449db0636e6b1af6dbb5d#diff-729a985b0cb8b431cb291f1edb561bbbfea22e3f8c262451cd83328a0936a342
https://github.com/python/cpython/blob/main/.github/CODEOWNERS#L230
Python/flowgraph.chttps://github.com/python/cpython/pull/106003/commits/d31407825cac7b01443449db0636e6b1af6dbb5d#diff-3cbf15668c31488528b7ab0f903c674a0ecf550f4f53c1be6cf8cd965246c2a0
View file https://github.com/brandtbucher/cpython/blob/d31407825cac7b01443449db0636e6b1af6dbb5d/Python/flowgraph.c
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/106003/commits/{{ revealButtonHref }}
https://github.com/python/cpython/pull/106003/commits/d31407825cac7b01443449db0636e6b1af6dbb5d#diff-3cbf15668c31488528b7ab0f903c674a0ecf550f4f53c1be6cf8cd965246c2a0
https://github.com/python/cpython/pull/106003/commits/d31407825cac7b01443449db0636e6b1af6dbb5d#diff-3cbf15668c31488528b7ab0f903c674a0ecf550f4f53c1be6cf8cd965246c2a0
https://github.com/python/cpython/pull/106003/commits/d31407825cac7b01443449db0636e6b1af6dbb5d#diff-3cbf15668c31488528b7ab0f903c674a0ecf550f4f53c1be6cf8cd965246c2a0
https://github.com/python/cpython/pull/106003/commits/d31407825cac7b01443449db0636e6b1af6dbb5d#diff-3cbf15668c31488528b7ab0f903c674a0ecf550f4f53c1be6cf8cd965246c2a0
Please reload this pagehttps://github.com/python/cpython/pull/106003/commits/d31407825cac7b01443449db0636e6b1af6dbb5d
https://github.com/python/cpython/pull/106003/commits/d31407825cac7b01443449db0636e6b1af6dbb5d#diff-3cbf15668c31488528b7ab0f903c674a0ecf550f4f53c1be6cf8cd965246c2a0
Please reload this pagehttps://github.com/python/cpython/pull/106003/commits/d31407825cac7b01443449db0636e6b1af6dbb5d
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.