René's URL Explorer Experiment


Title: Align function construction and metadata controls by youknowdot · Pull Request #9717 · RustPython/RustPython · GitHub

Open Graph Title: Align function construction and metadata controls by youknowdot · Pull Request #9717 · RustPython/RustPython

X Title: Align function construction and metadata controls by youknowdot · Pull Request #9717 · RustPython/RustPython

Description: Summary Align function construction and public metadata controls with Python 3.15 with focused Python regression coverage. Use the default Clinic-compatible FromArgs binder before validating supplied objects. Accept code/globals keywords, retain raw argument owners, and match closure/default/kwdefault validation order and constructor audit veto. Emit public code/default/kwdefault read and mutation audits with the correct payloads and None-as-delete behavior. Read live fields after hooks and propagate vetoes before changes. Keep internal defaults accessors unaudited and release all locks before hooks or finalizers. Match code/name/type-parameter setter diagnostics, using the live function name after audit. Preserve lone-surrogate names in function repr and closure-count errors without invoking string-subclass formatting callbacks. Initialize doc only from a string first constant when the code declares a docstring. Preserve existing metadata identity, version invalidation and release-outside-lock behavior. No handwritten per-function argument parser, Lib, markers or workflow changes. A direct function.__new__ error-formatting lifetime regression is covered in extra_tests/snippets/syntax_function.py. Existing bound-method and annotation changes remain outside this patch. Validation Compared with pinned CPython function controls and its generated Clinic signature. Independent source review passed, including owner lifetimes, audit timing/payloads, lock boundaries and unaudited internal callers. Reference probes passed 71 metadata cases, four doc initialization cases, 1,024 positional/keyword layouts compared with the shared binder model, and 27 additional metadata/Unicode/hook cases. Constructed or modified code/functions were only inspected, never executed. These are CPython/source checks, not a RustPython runtime pass. Limits and integration Old code ownership remains deferred by the existing swap_to_temporary_refs mechanism. CPython releases old code constants earlier, but changing that here would undermine the outstanding-borrow safety design; no immediate-destruction parity is claimed. Shared unexpected-keyword surrogate formatting also remains unchanged. Function deallocation/GC redesign, JIT behavior and annotation reentrancy are outside scope. Fresh relevant PR patches were checked and do not duplicate this group. Composing #9715 has one textual conflict in function.rs imports: retain this patch's PyDict/PyTypeRef imports and remove PyList once its custom method directory is removed. Independent read-only apply checks confirmed all other hunks apply after that import-only resolution. Combined branches were not compiled or executed. Preserve #9700 annotation diagnostics; that region is unchanged here. #6894 changes freevar representation, and #8624 has adjacent JIT invalidation work that requires preserving its logic if integrated. No combined runtime claim is made. The latest local validation is recorded below. Separate cross-platform graphs still require hosted CI. AI-assisted implementation and independent review using OpenAI Codex; model version is not exposed. Clinic binding follow-up (2026-11-07) Remove the custom slot_new, its ArgSpec slot vector, and duplicate argument-owner clones. The default Clinic binder handles the structural checks. Keep raw argument owners intentionally. Eager typed conversion can run earlier arguments' finalizers before a later argument error is formatted in direct function.__new__ calls. A code constant finalizer can even rename the rejected globals type and change the error text. This is an ownership requirement, not a remaining Clinic binding mismatch. No new runtime guard or converter is introduced. Replace the two remaining redundant setter tail drops with scoped _old bindings, preserving lock release, version invalidation, and finalizer order. Validation on the final local tree: Normal repository commit hooks passed. Full workspace tests (documented exclusions), C-API tests, and workspace/C-API all-targets Clippy with -D warnings passed. Release test_funcattrs: 36 tests, one skip, success. 1,268 constructor layout/value/ownership probes match the previous PR head; direct-__new__ error-owner and setter-finalizer reentry probes pass. Native snippet suite: 242 passed, six failed. The same six fail on the previous PR head (multiprocessing condition/fork-sharer/sharedctypes, os, socket, sqlite; sandbox/optional-module constraints). The remaining error-formatting lifetime regression passes. CPython 3.15 source was inspected; the retained ownership probe also passes on the available system CPython 3.12. No CPython 3.15 local runtime claim. Hosted CI for the new commit is checked separately. CPython 3.15 CI correction The first follow-up test incorrectly fixed the relative cleanup order observed on CPython 3.12. Actual CPython 3.15 CI finalizes those temporary arguments in the opposite order. Commit 4623020bc8 removes that unsupported ordering assertion; it retains the regression requiring the globals TypeError to be formatted before a code-constant finalizer can rename the rejected type. CPython 3.15 func_new and _PyArg_BadArgument source independently confirm this remaining requirement. Production Rust code is unchanged from 311f2e81b7, so its workspace/C-API/Clippy validation still applies. The corrected exact snippet passes locally on RustPython and system CPython, and the native snippet suite again has the same 242 passes and six baseline environment failures. New hosted CI supplies the actual CPython 3.15 check. Actual CPython 3.15 CI verification for 4623020bc864ae2ca9c8b99cbe76de69e35d5b69: the full run snippets step passed on Ubuntu, macOS, and Windows. This resolves the three reported snippet failures. Other CI stages were still running at verification time; this is not a claim that the whole workflow is green. Compatibility conclusions use CPython 3.15 source and these actual 3.15 runs, not the older local interpreter.

Open Graph Description: Summary Align function construction and public metadata controls with Python 3.15 with focused Python regression coverage. Use the default Clinic-compatible FromArgs binder before validating suppl...

X Description: Summary Align function construction and public metadata controls with Python 3.15 with focused Python regression coverage. Use the default Clinic-compatible FromArgs binder before validating suppl...

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

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:a68afcb4-a94e-a43d-7b58-f2eb0d249102
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idC6F8:1EFF:96E854:C8E2B9:6B01FE37
html-safe-nonce7354d7ab7c43f724314b36d6d50925eeb58a733e3a79a2c83684b5b48ff3a7d0
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNkY4OjFFRkY6OTZFODU0OkM4RTJCOTo2QjAxRkUzNyIsInZpc2l0b3JfaWQiOiI0MjU3MzA5NDg0MTA1NDY1Mzk5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac14024d71f1d2195c482c90bf11494e318af4c7b03aa799902bbbbaddc60a979c
hovercard-subject-tagpull_request:5160211590
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/9717/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 Align function construction and public metadata controls with Python 3.15 with focused Python regression coverage. Use the default Clinic-compatible FromArgs binder before validating suppl...
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/9717/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FRustPython%2FRustPython%2Fpull%2F9717%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%2F9717%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/9717/files
Reloadhttps://github.com/RustPython/RustPython/pull/9717/files
Reloadhttps://github.com/RustPython/RustPython/pull/9717/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/function-controls-20261104https://github.com/youknowdot/RustPython/tree/fix/function-controls-20261104
Conversation 4 https://github.com/RustPython/RustPython/pull/9717
Commits 8 https://github.com/RustPython/RustPython/pull/9717/commits
Checks 19 https://github.com/RustPython/RustPython/pull/9717/checks
Files changed https://github.com/RustPython/RustPython/pull/9717/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9717/files
Align function construction and metadata controls https://github.com/RustPython/RustPython/pull/9717/files#top
Show all changes 8 commits https://github.com/RustPython/RustPython/pull/9717/files
8ecea77 Align function construction and metadata controls youknowdot Nov 4, 2026 https://github.com/RustPython/RustPython/pull/9717/commits/8ecea7719d070131868dffe5441243d2a81f1d5b
0167070 Keep canonical function metadata getter names codex Nov 6, 2026 https://github.com/RustPython/RustPython/pull/9717/commits/01670705b3b94383a51e84b5756bf989e543aa8c
3a62a86 Format rebased function imports youknowdot Nov 6, 2026 https://github.com/RustPython/RustPython/pull/9717/commits/3a62a8614af79f824c8e621879e6be516cb3c7ae
f31c918 Rely on scope cleanup for redundant explicit drops codex Nov 6, 2026 https://github.com/RustPython/RustPython/pull/9717/commits/f31c918df7eb5e9b68dfaaa45193671182247df5
6a43864 Use default Clinic binding for function construction codex Nov 7, 2026 https://github.com/RustPython/RustPython/pull/9717/commits/6a43864e6bbd80ffe098501d49c2c9d2ebd5b300
6c695fa Cover function constructor argument finalizer ordering codex Nov 7, 2026 https://github.com/RustPython/RustPython/pull/9717/commits/6c695fa6d5c622e8953fbf2f25539a0877396daa
311f2e8 Use scope cleanup for remaining function setter owners codex Nov 7, 2026 https://github.com/RustPython/RustPython/pull/9717/commits/311f2e81b7d58270231d232b552b2cca7664fa09
4623020 Avoid asserting version-specific function argument cleanup order codex Nov 7, 2026 https://github.com/RustPython/RustPython/pull/9717/commits/4623020bc864ae2ca9c8b99cbe76de69e35d5b69
Clear filters https://github.com/RustPython/RustPython/pull/9717/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9717/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9717/files
function.rs https://github.com/RustPython/RustPython/pull/9717/files#diff-42d321490bc76e3b57deebb41ff9815e8bbb7c976bb1b57a076d01f7bc347698
crossinterp.rs https://github.com/RustPython/RustPython/pull/9717/files#diff-265514b24c44d971d322829fb7a4344e34449bb4befecf4eb3d7e48c132d902e
syntax_function.py https://github.com/RustPython/RustPython/pull/9717/files#diff-b3be27292a012035b424e2a012d7e3a26dc43a4466a2cc690e33776f117d7f44
crates/vm/src/builtins/function.rshttps://github.com/RustPython/RustPython/pull/9717/files#diff-42d321490bc76e3b57deebb41ff9815e8bbb7c976bb1b57a076d01f7bc347698
View file https://github.com/youknowdot/RustPython/blob/4623020bc864ae2ca9c8b99cbe76de69e35d5b69/crates/vm/src/builtins/function.rs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/9717/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/9717/files#diff-42d321490bc76e3b57deebb41ff9815e8bbb7c976bb1b57a076d01f7bc347698
https://github.com/RustPython/RustPython/pull/9717/files#diff-42d321490bc76e3b57deebb41ff9815e8bbb7c976bb1b57a076d01f7bc347698
https://github.com/RustPython/RustPython/pull/9717/files#diff-42d321490bc76e3b57deebb41ff9815e8bbb7c976bb1b57a076d01f7bc347698
https://github.com/RustPython/RustPython/pull/9717/files#diff-42d321490bc76e3b57deebb41ff9815e8bbb7c976bb1b57a076d01f7bc347698
https://github.com/RustPython/RustPython/pull/9717/files#diff-42d321490bc76e3b57deebb41ff9815e8bbb7c976bb1b57a076d01f7bc347698
https://github.com/RustPython/RustPython/pull/9717/files#diff-42d321490bc76e3b57deebb41ff9815e8bbb7c976bb1b57a076d01f7bc347698
https://github.com/RustPython/RustPython/pull/9717/files#diff-42d321490bc76e3b57deebb41ff9815e8bbb7c976bb1b57a076d01f7bc347698
https://github.com/RustPython/RustPython/pull/9717/files#diff-42d321490bc76e3b57deebb41ff9815e8bbb7c976bb1b57a076d01f7bc347698
https://github.com/RustPython/RustPython/pull/9717/files#diff-42d321490bc76e3b57deebb41ff9815e8bbb7c976bb1b57a076d01f7bc347698
https://github.com/RustPython/RustPython/pull/9717/files#diff-42d321490bc76e3b57deebb41ff9815e8bbb7c976bb1b57a076d01f7bc347698
https://github.com/RustPython/RustPython/pull/9717/files#diff-42d321490bc76e3b57deebb41ff9815e8bbb7c976bb1b57a076d01f7bc347698
https://github.com/RustPython/RustPython/pull/9717/files#diff-42d321490bc76e3b57deebb41ff9815e8bbb7c976bb1b57a076d01f7bc347698
https://github.com/RustPython/RustPython/pull/9717/files#diff-42d321490bc76e3b57deebb41ff9815e8bbb7c976bb1b57a076d01f7bc347698
crates/vm/src/vm/crossinterp.rshttps://github.com/RustPython/RustPython/pull/9717/files#diff-265514b24c44d971d322829fb7a4344e34449bb4befecf4eb3d7e48c132d902e
View file https://github.com/youknowdot/RustPython/blob/4623020bc864ae2ca9c8b99cbe76de69e35d5b69/crates/vm/src/vm/crossinterp.rs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/9717/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/9717/files#diff-265514b24c44d971d322829fb7a4344e34449bb4befecf4eb3d7e48c132d902e
https://github.com/RustPython/RustPython/pull/9717/files#diff-265514b24c44d971d322829fb7a4344e34449bb4befecf4eb3d7e48c132d902e
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9717/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9717/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.