René's URL Explorer Experiment


Title: Align bisect bounds and callback controls by youknowdot · Pull Request #9629 · RustPython/RustPython · GitHub

Open Graph Title: Align bisect bounds and callback controls by youknowdot · Pull Request #9629 · RustPython/RustPython

X Title: Align bisect bounds and callback controls by youknowdot · Pull Request #9629 · RustPython/RustPython

Description: Summary Consolidate the bisect bounds/callback work and #9630's insort result-disposal fix. Request sequence length only for an omitted, None, or -1 upper bound. Snapshot the sequence item slot even for an empty range. Bind the call before running __index__, finish lo conversion and nonnegative validation before converting hi, and preserve the original arguments through callbacks and insertion-result disposal. Restore CPython's native recursion guard around each search, including the cached same-type comparison path. Release the current item after leaving recursion on failure. Cache the original needle type's identity and comparison slot without retaining the type. Keep the shortcut across mixed-type probes and disable it after NotImplemented. Match the distinct lo and hi overflow/type diagnostics, including 200-byte type-name truncation. Discard custom insert() results and return None from both insort directions. Conversion and ownership The bound fields remain deferred objects because plain eager ArgIndex does not include native-size/negative validation and would convert hi too soon. Conversion still uses the shared ArgIndex, now through TryFromBorrowedObject; its existing owned interface is preserved by the blanket implementation. This removes an input incref/decref per supplied bound. The search stores a pointer-sized type identity rather than another type owner. Unkeyed insort borrows the existing input instead of cloning it. Error cleanup moves the existing midpoint owner, with no new allocation or incref/decref. The native recursion check runs once per search, matching CPython. Consolidation The branch includes current main at 1875dd8b207d and the latest #9630 head 28395170fc39 as merge ancestors. #9630's final redundant-clone lint expectations are superseded by borrowed arguments; its result-disposal and input-lifetime behavior is retained. No unrelated PR is included. Validation Independent source review against CPython 3.15.0 passed. Native release build passed. test_bisect: all 46 tests passed. Expanded extra_tests/snippets/stdlib_bisect.py passed on RustPython and CPython 3.15.0, including all-native recursion, conversion ordering/errors, type ownership, and insert-result disposal. The 56-line bounds/callback observable probe and eight additional ownership/error-cleanup cases matched CPython 3.15.0 exactly. Full-workspace all-targets Clippy and separate C-API all-targets Clippy passed with -D warnings. Full-workspace Rust tests passed (excluding wasm, venvlauncher, and C-API as prescribed). Separate C-API tests passed: 149 passed, 2 ignored. Normal commit hooks and formatting passed. The class-collection regression uses a separate assignment helper so it tests bisect's cached ownership independently of RustPython's existing rule retaining reassigned classes until the assigning frame exits. This PR does not change that VM-wide lifetime policy or add the existing missing exact-list insertion fast path. Cross-platform runtime validation has not been run. Summary by CodeRabbit Bug Fixes Improved bisect and insertion handling of search bounds, including negative or oversized values, invalid types, and omitted bounds. Corrected insertion behavior when using a key function; insertion methods return None. Improved error handling for recursive comparisons, indexing, and comparison callbacks. Added recursion-depth checks on WebAssembly builds. Tests Added coverage for argument validation, conversion errors, recursive comparisons, and insertion behavior.

Open Graph Description: Summary Consolidate the bisect bounds/callback work and #9630's insort result-disposal fix. Request sequence length only for an omitted, None, or -1 upper bound. Snapshot the sequence item slo...

X Description: Summary Consolidate the bisect bounds/callback work and #9630's insort result-disposal fix. Request sequence length only for an omitted, None, or -1 upper bound. Snapshot the sequence item...

Opengraph URL: https://github.com/RustPython/RustPython/pull/9629

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:e4dc0e13-e635-08d1-d70d-b4666f23cc48
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idA684:2A98A:FBD28:13D1FB:6B01FE37
html-safe-nonce90af9ea05458b61f2a4735cb4ec4ffe64edba044cfd673d01766205f529a2025
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNjg0OjJBOThBOkZCRDI4OjEzRDFGQjo2QjAxRkUzNyIsInZpc2l0b3JfaWQiOiI5ODcwMjk5MDIxMjc2NjA1OTkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac0073427a095e886456ab6265fb803238ad1fbe20d1d2301dba18782e3537d832
hovercard-subject-tagpull_request:5138800102
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/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/RustPython/RustPython/pull/9629/files
twitter:imagehttps://avatars.githubusercontent.com/u/336763669?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/336763669?s=400&v=4
og:image:altSummary Consolidate the bisect bounds/callback work and #9630's insort result-disposal fix. Request sequence length only for an omitted, None, or -1 upper bound. Snapshot the sequence item slo...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/RustPython/RustPython git https://github.com/RustPython/RustPython.git
octolytics-dimension-user_id39710557
octolytics-dimension-user_loginRustPython
octolytics-dimension-repository_id135201145
octolytics-dimension-repository_nwoRustPython/RustPython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id135201145
octolytics-dimension-repository_network_root_nwoRustPython/RustPython
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release423dbb54c5e7bfecc838eb387c1435eb3d0e760d
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/RustPython/RustPython/pull/9629/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FRustPython%2FRustPython%2Fpull%2F9629%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
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
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://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/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FRustPython%2FRustPython%2Fpull%2F9629%2Ffiles
Sign uphttps://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%2Ffiles&source=header-repo&source_repo=RustPython%2FRustPython
Reloadhttps://github.com/RustPython/RustPython/pull/9629/files
Reloadhttps://github.com/RustPython/RustPython/pull/9629/files
Reloadhttps://github.com/RustPython/RustPython/pull/9629/files
RustPythonhttps://github.com/RustPython
RustPythonhttps://github.com/RustPython/RustPython
Codehttps://github.com/RustPython/RustPython
Issues195 (195)https://github.com/RustPython/RustPython/issues
Pull requests133 (133)https://github.com/RustPython/RustPython/pulls
Discussionshttps://github.com/RustPython/RustPython/discussions
Actionshttps://github.com/RustPython/RustPython/actions
Projectshttps://github.com/RustPython/RustPython/projects
Wikihttps://github.com/RustPython/RustPython/wiki
Security and qualityhttps://github.com/RustPython/RustPython/security
Insightshttps://github.com/RustPython/RustPython/insights
Sign up for GitHub https://github.com/signup?return_to=%2FRustPython%2FRustPython%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2FRustPython%2FRustPython%2Fissues%2Fnew%2Fchoose
youknowonehttps://github.com/youknowone
RustPython:mainhttps://github.com/RustPython/RustPython/tree/main
youknowdot:fix/bisect-explicit-upper-bound-20261103https://github.com/youknowdot/RustPython/tree/fix/bisect-explicit-upper-bound-20261103
Conversation 7 https://github.com/RustPython/RustPython/pull/9629
Commits 13 https://github.com/RustPython/RustPython/pull/9629/commits
Checks 27 https://github.com/RustPython/RustPython/pull/9629/checks
Files changed https://github.com/RustPython/RustPython/pull/9629/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9629/files
Align bisect bounds and callback controls https://github.com/RustPython/RustPython/pull/9629/files#top
Show all changes 13 commits https://github.com/RustPython/RustPython/pull/9629/files
adae508 Honor explicit bisect upper bounds youknowdot Nov 3, 2026 https://github.com/RustPython/RustPython/pull/9629/commits/adae508b7a6c39d7ac12c10d57e0da45cbd5c55d
611849f Return None from bisect insort youknowdot Nov 3, 2026 https://github.com/RustPython/RustPython/pull/9629/commits/611849f857c93ec3dd755168ff1a444c02cd9d53
b5e7190 Validate bisect bounds before callbacks youknowdot Nov 3, 2026 https://github.com/RustPython/RustPython/pull/9629/commits/b5e719068ba3568d918180665dd8bd3300ffd69b
e1695a2 Reuse ArgIndex for delayed bisect conversions youknowdot Nov 4, 2026 https://github.com/RustPython/RustPython/pull/9629/commits/e1695a223fa89855fb182d7b0c6b1b3e97c4d38e
4a9b7e1 Compose bisect bound controls with insort result disposal youknowdot Nov 4, 2026 https://github.com/RustPython/RustPython/pull/9629/commits/4a9b7e182ca5654bbf65a051e67c5a38c4c29795
f04eb4f Borrow insort input through shared argument conversion youknowdot Nov 4, 2026 https://github.com/RustPython/RustPython/pull/9629/commits/f04eb4f81ddf04a0f9c537a595dcd8098411c2bd
2839517 Preserve insort argument lifetime under Clippy youknowdot Nov 4, 2026 https://github.com/RustPython/RustPython/pull/9629/commits/28395170fc393de1ecb337ffe3abf23d4cf4c9df
aa3ad6b Preserve bisect comparison dispatch and key input lifetimes youknowdot Nov 4, 2026 https://github.com/RustPython/RustPython/pull/9629/commits/aa3ad6bd7a7e59c6cb5e623e282a602de8a68955
e94bfae Merge current main into consolidated bisect compatibility work codex Nov 6, 2026 https://github.com/RustPython/RustPython/pull/9629/commits/e94bfae56609a1898ac7093201842d380f023d85
b221a77 Preserve bisect recursion and conversion lifetimes codex Nov 6, 2026 https://github.com/RustPython/RustPython/pull/9629/commits/b221a77b8b0e6d2e772f0cde584610b122af2078
03b0e0c Consolidate the final insort result-disposal update codex Nov 6, 2026 https://github.com/RustPython/RustPython/pull/9629/commits/03b0e0c47521e08f4c6c114f847b690f59eeb0ce
1eae2eb Isolate bisect type-ownership regression from frame retention codex Nov 6, 2026 https://github.com/RustPython/RustPython/pull/9629/commits/1eae2eb5b1534c20bfd79f9befc0075661096136
f01f170 Bound native recursion on WebAssembly codex Nov 6, 2026 https://github.com/RustPython/RustPython/pull/9629/commits/f01f170b80cae2c28d27ff47182d2394e815226c
Clear filters https://github.com/RustPython/RustPython/pull/9629/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9629/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9629/files
bisect.rs https://github.com/RustPython/RustPython/pull/9629/files#diff-a315142cbd74ce29a74ac04b25cea56eac16541854672cbbcf2eebb1758b3649
number.rs https://github.com/RustPython/RustPython/pull/9629/files#diff-4b6c8f777cc85a356e8cfd03078d3119eeecaa76f326aac365e67c91c724a8ae
mod.rs https://github.com/RustPython/RustPython/pull/9629/files#diff-fe30ecf7c6b462e46e0874a55a05ea0edba83cefad5ac7a86e7137fa8f86ba74
thread.rs https://github.com/RustPython/RustPython/pull/9629/files#diff-0bfe10fdb30f1f6c60e31b36e738b86cd68863aeb8113c4c1eadec33e90caf8d
stdlib_bisect.py https://github.com/RustPython/RustPython/pull/9629/files#diff-6898ef6f57dec9d78b87ef820a06c7d65e4208c16b84d118944cb3f6eaac0281
crates/stdlib/src/bisect.rshttps://github.com/RustPython/RustPython/pull/9629/files#diff-a315142cbd74ce29a74ac04b25cea56eac16541854672cbbcf2eebb1758b3649
View file https://github.com/youknowdot/RustPython/blob/f01f170b80cae2c28d27ff47182d2394e815226c/crates/stdlib/src/bisect.rs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/9629/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/9629/files#diff-a315142cbd74ce29a74ac04b25cea56eac16541854672cbbcf2eebb1758b3649
youknowonehttps://github.com/youknowone
Nov 4, 2026https://github.com/RustPython/RustPython/pull/9629/files#r4462431439
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9629/files
coderabbitaihttps://github.com/apps/coderabbitai
Nov 6, 2026https://github.com/RustPython/RustPython/pull/9629/files#r4491255076
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9629/files
crates/vm/src/function/number.rshttps://github.com/RustPython/RustPython/pull/9629/files#diff-4b6c8f777cc85a356e8cfd03078d3119eeecaa76f326aac365e67c91c724a8ae
View file https://github.com/youknowdot/RustPython/blob/f01f170b80cae2c28d27ff47182d2394e815226c/crates/vm/src/function/number.rs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/9629/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/9629/files#diff-4b6c8f777cc85a356e8cfd03078d3119eeecaa76f326aac365e67c91c724a8ae
https://github.com/RustPython/RustPython/pull/9629/files#diff-4b6c8f777cc85a356e8cfd03078d3119eeecaa76f326aac365e67c91c724a8ae
https://github.com/RustPython/RustPython/pull/9629/files#diff-4b6c8f777cc85a356e8cfd03078d3119eeecaa76f326aac365e67c91c724a8ae
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9629/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9629/files
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.