René's URL Explorer Experiment


Title: Align builtin iterator controls and callback lifetimes by youknowdot · Pull Request #9699 · RustPython/RustPython · GitHub

Open Graph Title: Align builtin iterator controls and callback lifetimes by youknowdot · Pull Request #9699 · RustPython/RustPython

X Title: Align builtin iterator controls and callback lifetimes by youknowdot · Pull Request #9699 · RustPython/RustPython

Description: Summary Group builtin iterator controls and callback lifetimes in 817 changed production lines (+588/-229): Reuse typed argument binders and share map/zip strict conversion, iterator acquisition and mismatch handling. Convert strict before acquiring iterators, propagate setstate conversion errors and preserve nonstrict native exceptions. Retain constructor-owned raw inputs across conversion callbacks and share their cleanup instead of per-function parsing. Preserve filter subclasses in reduction and align filter result cleanup. Compare callable-iterator sentinels in CPython's order, latch callable StopIteration, and release exhausted callable/sentinel owners outside locks. Snapshot callable reduction state before tuple allocation. Release the temporary sentinel comparison owner before truth conversion, preserving reentrant finalizer behavior. Share generic sequence/reverse iterator state without holding locks across sequence callbacks, allocation or owner release. Match empty/reverse exhaustion, strict signed state conversion, exception clearing and reentrant live-versus-captured indices. Preserve the pinned CPython signed-wrap behavior and negative-index normalization when callbacks change the live forward index to the native maximum. Nine production Rust files. No Python, Lib, tests, expected-failure markers or workflows changed. Shared list/tuple/range/itertools implementations are untouched. The strict signed-size conversion now uses the same borrowed helper as #9701, avoiding duplicate conversion logic while preserving the original state argument through mutation. This companion has no dependency on the native iterator engine. Export reversed as its actual subclassable type, bind its constructor through shared argument metadata, and honor special-method None and sequence checks without binding getitem merely to check support. Reconstruct reductions through the actual iterator type. Forward weakproxy reversal to the referent's ordinary method rather than the builtin fallback, preserving instance overrides and dead-referent errors. Reference and validation Compared with CPython commit d220409a13b77de7a6c30abe16ea90db01528edc: builtin iterator controls and callable iterators. 9,416 bounded CPython/source-model assertions passed, with additional independent lifecycle/error oracles. Coverage includes strict conversion and mismatch precedence, repeated calls, native StopIteration subclass data, state reentry, subclass reduction, callable equality/truth callbacks, resource release and resurrection. These are reference/model checks, not execution of the Rust implementation. Independent exact-source review passed after correcting two findings: tuple allocation while a callable state read guard was held, and sentinel ownership extending across a reentrant truth callback. Focused host-env/VM/stdlib threading cargo check, normal all-targets Clippy and ordinary commit hooks passed. Clippy emitted exactly four unchanged main-baseline diagnostics: one POSIX needless-collect and three ElementTree lints. Strict -D warnings remains blocked by that baseline; no warnings were suppressed. Native RustPython execution was not performed. Full workspace/C-API suites and cross-platform runtime tests remain unrun. Hosted CI is required; no runtime expected failure is claimed resolved. The generic sequence/reverse companion passed 16,003 further bounded CPython/source-model assertions and independent callback/finalizer probes. Independent review caught and corrected reentrant MAX wrapping and verified the final composition preserves the original map/zip/filter/callable code byte-for-byte. Reference: sequence iterators and reversed. Remaining limits PyType::call retains separate init_args for ordinary type calls. The new cleanup order governs constructor-owned references/direct constructor paths; it does not establish complete ordinary-call finalizer parity while inherited object.init/FuncArgs still own those values. Generic iterator wrappers may already normalize user StopIteration subclasses before these consumers receive them. The patch preserves original native errors where they remain available. Zip's existing result allocation lacks CPython's cached tuple, so result identity/refcounts and partial-result finalizer timing remain different. Existing enumerate allocation-under-counter-lock behavior is unchanged. Reversed constructor raw argument ownership is retained through callbacks; inherited ordinary type-call init_args and shared binder teardown behavior remain outside this change. Shared binder diagnostics and existing cross-thread scheduling/allocation timing remain outside scope. Old ownership/layout PRs may need textual reconciliation. The reversed constructor/proxy companion passed 86 bounded pinned-CPython assertions and independent source/lifecycle/metadata review. All generic iterator state mechanics remain unchanged by this companion. AI-assisted contribution by OpenAI Codex, disclosed in the commit trailer.

Open Graph Description: Summary Group builtin iterator controls and callback lifetimes in 817 changed production lines (+588/-229): Reuse typed argument binders and share map/zip strict conversion, iterator acquisition ...

X Description: Summary Group builtin iterator controls and callback lifetimes in 817 changed production lines (+588/-229): Reuse typed argument binders and share map/zip strict conversion, iterator acquisition ...

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

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:59b52c99-46d1-5e58-f581-cf3386fd29ca
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id9BB0:5D487:1442E26:1ADF0A4:6B01FA00
html-safe-nonce19f1b2a91eca65df65b5855609c1cfce2e69d9570d3a836d247a666bd53e859d
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QkIwOjVENDg3OjE0NDJFMjY6MUFERjBBNDo2QjAxRkEwMCIsInZpc2l0b3JfaWQiOiIxMTMyMzMxNjIyMTYzNjc1NjQ4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac462d382b0d610c00e89949ae25bf159eeac27588fe8117285eeb3f9ce3dba077
hovercard-subject-tagpull_request:5153055036
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/9699/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 builtin iterator controls and callback lifetimes in 817 changed production lines (+588/-229): Reuse typed argument binders and share map/zip strict conversion, iterator acquisition ...
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/9699/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FRustPython%2FRustPython%2Fpull%2F9699%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%2F9699%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/9699/files
Reloadhttps://github.com/RustPython/RustPython/pull/9699/files
Reloadhttps://github.com/RustPython/RustPython/pull/9699/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/builtin-iterator-controls-20261104https://github.com/youknowdot/RustPython/tree/fix/builtin-iterator-controls-20261104
Conversation 4 https://github.com/RustPython/RustPython/pull/9699
Commits 6 https://github.com/RustPython/RustPython/pull/9699/commits
Checks 28 https://github.com/RustPython/RustPython/pull/9699/checks
Files changed https://github.com/RustPython/RustPython/pull/9699/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9699/files
Align builtin iterator controls and callback lifetimes https://github.com/RustPython/RustPython/pull/9699/files#top
Show all changes 6 commits https://github.com/RustPython/RustPython/pull/9699/files
5d227f7 Align builtin iterator controls and callback lifetimes youknowdot Nov 4, 2026 https://github.com/RustPython/RustPython/pull/9699/commits/5d227f7ca38e68182390fefb80983f80e5310b55
2bdbe04 Share generic sequence iterator callback controls youknowdot Nov 4, 2026 https://github.com/RustPython/RustPython/pull/9699/commits/2bdbe0427454a64cd509b9ba1210971c0f0322bb
3ac5895 Share strict iterator ssize conversion youknowdot Nov 4, 2026 https://github.com/RustPython/RustPython/pull/9699/commits/3ac5895566a8767cbd487d1141ca2ba843bab695
163c697 Align reversed construction and proxy dispatch youknowdot Nov 4, 2026 https://github.com/RustPython/RustPython/pull/9699/commits/163c697d12012af38e920df5aab2e99cd46ca02c
2673882 Return reversed reduction without redundant result wrapper youknowdot Nov 4, 2026 https://github.com/RustPython/RustPython/pull/9699/commits/26738823b0ce45914d9bc25cac5a9807623888f0
46ff99a Return integers from byte sequence item slots youknowdot Nov 5, 2026 https://github.com/RustPython/RustPython/pull/9699/commits/46ff99a15d5bbb75f9a6df4daf3dc7052394c442
Clear filters https://github.com/RustPython/RustPython/pull/9699/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9699/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9699/files
bytearray.rs https://github.com/RustPython/RustPython/pull/9699/files#diff-bd8962db12555ddc9945c543b57069611c9b3f24f133fbf3a76c7c60fe1cfddd
bytes.rs https://github.com/RustPython/RustPython/pull/9699/files#diff-6b402f3feb41119eef6e230cb7efe615c9804a4ed5ce25dc9121ed85ed495343
enumerate.rs https://github.com/RustPython/RustPython/pull/9699/files#diff-ac28914839c33e71a891ba12a6fdc5efaa82b1fbaef69962c2974765eb374ffd
filter.rs https://github.com/RustPython/RustPython/pull/9699/files#diff-f388df7b6dd6e169c3bcb30964c067ae52ddbe235f8e514395e1f4c1ae461d19
iter.rs https://github.com/RustPython/RustPython/pull/9699/files#diff-5e6ed19116602aff33f842f06bc7498b9b4f1db5af79374b94c88e1eeb1769e3
map.rs https://github.com/RustPython/RustPython/pull/9699/files#diff-9d8b662784578934c3f5c88f40951c2678d8528b3092c753432fd28cfc9cc0da
weakproxy.rs https://github.com/RustPython/RustPython/pull/9699/files#diff-518160a6bf622184ad8479c3ae06ed1013978232d9059a602482e6a0fd03f17a
zip.rs https://github.com/RustPython/RustPython/pull/9699/files#diff-15b452b575a291c7eae085dae3c21ae6f245a4571e5250c2a9103515740f6776
builtins.rs https://github.com/RustPython/RustPython/pull/9699/files#diff-ce8bd80bb61ce870dbf04415913693df814ebda260d3fc784b689a657e694ca3
crates/vm/src/builtins/bytearray.rshttps://github.com/RustPython/RustPython/pull/9699/files#diff-bd8962db12555ddc9945c543b57069611c9b3f24f133fbf3a76c7c60fe1cfddd
View file https://github.com/youknowdot/RustPython/blob/46ff99a15d5bbb75f9a6df4daf3dc7052394c442/crates/vm/src/builtins/bytearray.rs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/9699/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/9699/files#diff-bd8962db12555ddc9945c543b57069611c9b3f24f133fbf3a76c7c60fe1cfddd
https://github.com/RustPython/RustPython/pull/9699/files#diff-bd8962db12555ddc9945c543b57069611c9b3f24f133fbf3a76c7c60fe1cfddd
crates/vm/src/builtins/bytes.rshttps://github.com/RustPython/RustPython/pull/9699/files#diff-6b402f3feb41119eef6e230cb7efe615c9804a4ed5ce25dc9121ed85ed495343
View file https://github.com/youknowdot/RustPython/blob/46ff99a15d5bbb75f9a6df4daf3dc7052394c442/crates/vm/src/builtins/bytes.rs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/9699/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/9699/files#diff-6b402f3feb41119eef6e230cb7efe615c9804a4ed5ce25dc9121ed85ed495343
https://github.com/RustPython/RustPython/pull/9699/files#diff-6b402f3feb41119eef6e230cb7efe615c9804a4ed5ce25dc9121ed85ed495343
crates/vm/src/builtins/enumerate.rshttps://github.com/RustPython/RustPython/pull/9699/files#diff-ac28914839c33e71a891ba12a6fdc5efaa82b1fbaef69962c2974765eb374ffd
View file https://github.com/youknowdot/RustPython/blob/46ff99a15d5bbb75f9a6df4daf3dc7052394c442/crates/vm/src/builtins/enumerate.rs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/9699/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/9699/files#diff-ac28914839c33e71a891ba12a6fdc5efaa82b1fbaef69962c2974765eb374ffd
https://github.com/RustPython/RustPython/pull/9699/files#diff-ac28914839c33e71a891ba12a6fdc5efaa82b1fbaef69962c2974765eb374ffd
https://github.com/RustPython/RustPython/pull/9699/files#diff-ac28914839c33e71a891ba12a6fdc5efaa82b1fbaef69962c2974765eb374ffd
https://github.com/RustPython/RustPython/pull/9699/files#diff-ac28914839c33e71a891ba12a6fdc5efaa82b1fbaef69962c2974765eb374ffd
crates/vm/src/builtins/filter.rshttps://github.com/RustPython/RustPython/pull/9699/files#diff-f388df7b6dd6e169c3bcb30964c067ae52ddbe235f8e514395e1f4c1ae461d19
View file https://github.com/youknowdot/RustPython/blob/46ff99a15d5bbb75f9a6df4daf3dc7052394c442/crates/vm/src/builtins/filter.rs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/9699/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/9699/files#diff-f388df7b6dd6e169c3bcb30964c067ae52ddbe235f8e514395e1f4c1ae461d19
https://github.com/RustPython/RustPython/pull/9699/files#diff-f388df7b6dd6e169c3bcb30964c067ae52ddbe235f8e514395e1f4c1ae461d19
https://github.com/RustPython/RustPython/pull/9699/files#diff-f388df7b6dd6e169c3bcb30964c067ae52ddbe235f8e514395e1f4c1ae461d19
https://github.com/RustPython/RustPython/pull/9699/files#diff-f388df7b6dd6e169c3bcb30964c067ae52ddbe235f8e514395e1f4c1ae461d19
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9699/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9699/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.