René's URL Explorer Experiment


Title: Align builtin reduction callback controls by youknowdot · Pull Request #9718 · RustPython/RustPython · GitHub

Open Graph Title: Align builtin reduction callback controls by youknowdot · Pull Request #9718 · RustPython/RustPython

X Title: Align builtin reduction callback controls by youknowdot · Pull Request #9718 · RustPython/RustPython

Description: Summary Group CPython 3.15 min/max streaming, sum and all/any iteration, argument binding and callback ownership controls in 274 changed lines across three production Rust files. Consume a single iterable one item at a time, interleaving key and comparison callbacks without materialization or length-hint calls. Multiple positional candidates use borrowed caller slots. Keep raw caller arguments alive until internal cleanup finishes. Share one min/max engine with explicit winner/current item and key ownership and correct success/error release order. Reuse ArgSpec through a borrowed keyword-only entry point. Validate arity, keyword count/names and default restrictions before obtaining an iterator. Scope CPython-style typo suggestions and lossless WTF-8 keyword diagnostics to the new entry point. Reuse the existing suggestion algorithm with UTF-8 byte-length thresholds and suppress suggestions for surrogate-bearing names. Existing parser and suggestion consumers retain their behavior. Bind sum inputs before iterability checks, acquire and validate its iterator before rejected-start errors, and retain the original start through all callbacks. Preserve generic sum accumulator-before-item-before-iterator error cleanup without changing compensated arithmetic or numeric fast paths. Share one all/any engine with canonical iterator validation and one cached next slot. Python slot wrappers continue to resolve a replaced/deleted next dynamically, including mutation from truth callbacks and item finalizers. Preserve raw inputs, item-before-next cleanup, short circuiting and length-hint avoidance without changing generic iteration or min/max/sum traversal policy. Validation Pinned CPython reference: d220409a13b77de7a6c30abe16ea90db01528edc. The focused oracle passed 22 grouped assertions and recorded 30 outcomes/traces, covering streaming, mutation, length-hint avoidance, binding, defaults, comparisons, exception propagation and internal finalizer order. These are reference/source checks, not RustPython runtime tests. Independent source review passed, including 344 additional CPython diagnostic assertions over 172 keyword names. The initial compiler run caught a Result-versus-Option guard method mismatch; the corrected final source passed threaded cargo check in 1m05s and all-targets Clippy in 2m58s. All 12 unchanged baseline diagnostics match exactly, without suppression. Ordinary commit hooks passed. No tests, Lib files, expected failures or workflows are changed. Limits and integration The original validation used reference and source checks. Current native validation is recorded in the borrowed-source follow-up below. Full runtime differential tests and separate platform/feature graphs remain outside that validation; hosted CI is pending. Caller-frame argument destruction order can depend on the original call syntax, which FuncArgs no longer records. This patch retains raw owners through internal cleanup; it does not impose one universal caller-tail ordering or claim to solve that wider lifetime issue. Duplicate-keyword detection belongs to VM call binding before FuncArgs' unique-key map. PR #9668 makes ArgSpec fields and parse_with public. Read-only three-way source composition succeeds while retaining those public interfaces and the new shared parser internals; the combined graph was not compiled. #9699 does not implement min/max behavior, and the examined older builtin changes do not duplicate this group. Existing non-opted-in parser consumers' surrogate diagnostics and suggestion behavior remain unchanged. AI-assisted contribution by OpenAI Codex; assistance is disclosed in the commit trailer. Sum follow-up validation Independent exact-source review passed 30 pinned CPython oracle cases, 14 additional numeric error controls and the existing arithmetic snippet on CPython. Final threaded cargo check passed in 1m05s and all-targets Clippy in 2m17s; all 12 baseline diagnostics match unchanged. An initial redundant-clone diagnostic was fixed by making the existing iterator-then-raw-start release order explicit, without suppression or removing retention. Normal commit hooks passed. These earlier checks were reference/source and compilation checks; the current native results are recorded below. The sum wrapper continues to use shared FromArgs binding. Exact total-arity/duplicate-argument diagnostic precedence and keyword typo suggestions are deferred; this does not alter shared binder behavior for other functions. All/any follow-up validation Independent exact-source review passed bounded CPython controls for truth and item-finalizer next-slot mutation (eight cases), invalid iterator results, short circuiting, errors and length-hint avoidance. The existing test_all and test_any methods were extracted unchanged and passed on pinned CPython. Final threaded host-env/VM/stdlib cargo check passed in 1m11s, all-targets Clippy in 2m47s, and all 12 baseline diagnostics match unchanged. Normal commit hooks passed. A newly unused adapter import was removed before final validation. No native RustPython runtime test was included in that earlier validation; current results are recorded below. Terminal StopIteration conversion still uses the shared wrapper, which discards the original exception before returning its payload. This follow-up preserves the previous payload-before-iterator release order; full traceback-dependent terminal ownership parity remains deferred. Existing generic binder diagnostic precedence is unchanged. Borrowed-source follow-up Rebased independently onto main at fb57e68, preserving all seven prior commits patch-for-patch. The follow-up changes only the shared all/any helper: borrow &PyObject and obtain its iterator through get_iter, while each wrapper retains the original iterable through callbacks and cleanup. This removes coupling to an owned-reference type; it does not reduce reference-count clones, because get_iter still acquires an owned reference internally. Plain PyIter conversion would release the original source too early. The existing ArgIterable adapter retains its source but does not validate the object returned by __iter__ when acquiring it. Restoring that adapter to sum would move invalid-iterator rejection after invalid-start checks. A common source-retaining, once-validated iterator argument remains a separate proposal; no new conversion framework is introduced here. Independent review, formatting and ordinary commit hooks passed. This follow-up changes no tests, expected-failure markers or unrelated production files. Validation on exact commit 29ef984: Full workspace tests with the documented WASM, venvlauncher and C-API exclusions: 1,513 passed, 20 ignored across unit and documentation suites. Full workspace all-target Clippy and separate C-API all-target Clippy: passed with zero warnings. Both used ordinary Clippy without -D warnings. Separate C-API tests: 149 passed, 2 ignored. Fresh release RustPython -m test test_builtin: SUCCESS, 157 tests run and 14 skipped. Development and Rust test profiles used CARGO_PROFILE_DEV_DEBUG=0 and CARGO_PROFILE_TEST_DEBUG=0; release validation used the normal release profile. The safe existing CPython 3.12.14 host interpreter was verified in the fresh PyO3 build configuration. C-API checks used the repository's RustPython 3.15 configuration without an external interpreter. The CPython 3.15 comparison for this follow-up was source-only; no CPython 3.15 executable was run. Hosted CI for the updated head remains pending.

Open Graph Description: Summary Group CPython 3.15 min/max streaming, sum and all/any iteration, argument binding and callback ownership controls in 274 changed lines across three production Rust files. Consume a single...

X Description: Summary Group CPython 3.15 min/max streaming, sum and all/any iteration, argument binding and callback ownership controls in 274 changed lines across three production Rust files. Consume a single...

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

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:c2b0cbdd-6752-bd80-e221-264b384c126b
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idDB8E:1F2B:12258E6:1834694:6B01F393
html-safe-nonced78a2c0a42d390f6ad880de3c62d154568b409dfb2992bf431805a46939c72b2
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQjhFOjFGMkI6MTIyNThFNjoxODM0Njk0OjZCMDFGMzkzIiwidmlzaXRvcl9pZCI6Ijc1NzczMzc4NDQwNzE1MjczMTUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac1c59f16792eefbc615760746576e24457654f8b1275d6445dd19acfeee52e2a1
hovercard-subject-tagpull_request:5160675265
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/9718/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 Group CPython 3.15 min/max streaming, sum and all/any iteration, argument binding and callback ownership controls in 274 changed lines across three production Rust files. Consume a single...
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/9718/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FRustPython%2FRustPython%2Fpull%2F9718%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%2F9718%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/9718/files
Reloadhttps://github.com/RustPython/RustPython/pull/9718/files
Reloadhttps://github.com/RustPython/RustPython/pull/9718/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/minmax-streaming-controls-20261104https://github.com/youknowdot/RustPython/tree/fix/minmax-streaming-controls-20261104
Conversation 6 https://github.com/RustPython/RustPython/pull/9718
Commits 8 https://github.com/RustPython/RustPython/pull/9718/commits
Checks 27 https://github.com/RustPython/RustPython/pull/9718/checks
Files changed https://github.com/RustPython/RustPython/pull/9718/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9718/files
Align builtin reduction callback controls https://github.com/RustPython/RustPython/pull/9718/files#top
Show all changes 8 commits https://github.com/RustPython/RustPython/pull/9718/files
d42bbeb Stream min and max with shared argument controls youknowdot Nov 4, 2026 https://github.com/RustPython/RustPython/pull/9718/commits/d42bbeb9a228e37edfeea37c279839f26e42b4fb
c0a0c77 Preserve sum iterator and accumulator callback lifetimes youknowdot Nov 4, 2026 https://github.com/RustPython/RustPython/pull/9718/commits/c0a0c77544fd65744d64084685cdd9283c5ece86
277f257 Make retained sum argument release explicit youknowdot Nov 4, 2026 https://github.com/RustPython/RustPython/pull/9718/commits/277f25725aabdc3e0f0712be296a8b9f9c794519
3bc022a Share all and any iterator callback controls youknowdot Nov 4, 2026 https://github.com/RustPython/RustPython/pull/9718/commits/3bc022a8f6e9addb8d5383160db8b7b6de556ab9
a963221 Remove obsolete iterable adapter import youknowdot Nov 4, 2026 https://github.com/RustPython/RustPython/pull/9718/commits/a9632219ce1750a67235fa7548bbfba41db728fd
f39c6d1 Finish keyword binding adaptation to legacy argument slots youknowdot Nov 6, 2026 https://github.com/RustPython/RustPython/pull/9718/commits/f39c6d1410b2f7da0becea169b41505163dc52d3
7073db6 Rely on scope cleanup for redundant explicit drops codex Nov 6, 2026 https://github.com/RustPython/RustPython/pull/9718/commits/7073db6ee051df811c6ed1ebf8d54887141af1ce
29ef984 Borrow all and any sources through the object interface codex Nov 7, 2026 https://github.com/RustPython/RustPython/pull/9718/commits/29ef984cfe52e20aa989686fd28cdc409c774723
Clear filters https://github.com/RustPython/RustPython/pull/9718/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9718/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9718/files
legacy_args.rs https://github.com/RustPython/RustPython/pull/9718/files#diff-71d93987c18f8a0db99c4c90bb52d9f31da1f5ffc6b281f526608e4958ebf643
builtins.rs https://github.com/RustPython/RustPython/pull/9718/files#diff-ce8bd80bb61ce870dbf04415913693df814ebda260d3fc784b689a657e694ca3
suggestion.rs https://github.com/RustPython/RustPython/pull/9718/files#diff-ff73a63231fad23d61497a900ffdb97d4d97f5b4f0ecfe24f570aae2709eb8e4
crates/vm/src/function/legacy_args.rshttps://github.com/RustPython/RustPython/pull/9718/files#diff-71d93987c18f8a0db99c4c90bb52d9f31da1f5ffc6b281f526608e4958ebf643
View file https://github.com/youknowdot/RustPython/blob/29ef984cfe52e20aa989686fd28cdc409c774723/crates/vm/src/function/legacy_args.rs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/9718/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/9718/files#diff-71d93987c18f8a0db99c4c90bb52d9f31da1f5ffc6b281f526608e4958ebf643
https://github.com/RustPython/RustPython/pull/9718/files#diff-71d93987c18f8a0db99c4c90bb52d9f31da1f5ffc6b281f526608e4958ebf643
https://github.com/RustPython/RustPython/pull/9718/files#diff-71d93987c18f8a0db99c4c90bb52d9f31da1f5ffc6b281f526608e4958ebf643
https://github.com/RustPython/RustPython/pull/9718/files#diff-71d93987c18f8a0db99c4c90bb52d9f31da1f5ffc6b281f526608e4958ebf643
https://github.com/RustPython/RustPython/pull/9718/files#diff-71d93987c18f8a0db99c4c90bb52d9f31da1f5ffc6b281f526608e4958ebf643
https://github.com/RustPython/RustPython/pull/9718/files#diff-71d93987c18f8a0db99c4c90bb52d9f31da1f5ffc6b281f526608e4958ebf643
https://github.com/RustPython/RustPython/pull/9718/files#diff-71d93987c18f8a0db99c4c90bb52d9f31da1f5ffc6b281f526608e4958ebf643
https://github.com/RustPython/RustPython/pull/9718/files#diff-71d93987c18f8a0db99c4c90bb52d9f31da1f5ffc6b281f526608e4958ebf643
https://github.com/RustPython/RustPython/pull/9718/files#diff-71d93987c18f8a0db99c4c90bb52d9f31da1f5ffc6b281f526608e4958ebf643
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9718/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9718/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.