René's URL Explorer Experiment


Title: Align namespace, super and dictionary controls by youknowdot · Pull Request #9708 · RustPython/RustPython · GitHub

Open Graph Title: Align namespace, super and dictionary controls by youknowdot · Pull Request #9708 · RustPython/RustPython

X Title: Align namespace, super and dictionary controls by youknowdot · Pull Request #9708 · RustPython/RustPython

Description: Summary Group namespace, mapping-proxy, super lookup and dictionary lookup/iterator controls for Python 3.15 in six Rust source files (+441/-456). SimpleNamespace Convert non-exact dictionary inputs through the normal mapping protocol, validate all keys before mutation, and write instance dictionaries directly rather than invoking attribute setters/descriptors. Accept any SimpleNamespace subtype returned by replacement construction, retain its fields, and apply replacement keywords directly. Snapshot repr keys while looking up live values, reuse dictionary hash-error handling, and release snapshot owners backwards under the recursion guard on both success and error. Remove weak-reference support from the exact base while retaining normal subclass behavior. Mapping proxies and shared dictionary lookup Route containment through fallible mapping controls, propagating hash/equality failures rather than panicking. Native namespace fallback lookups also honor dictionary key callbacks. Delegate union and str to the underlying mappings, preserve arbitrary callback results, accept the named mapping constructor argument, and correct inplace-union diagnostics. Keep dictionary-backed class views and iterators attached to the actual namespace; copy remains a separate operation. Preserve #9128's defensive exact-dict copy for unknown comparison peers and #9039's raw comparison results. Revalidate shared read probes after equality and temporary-key finalizers. Check the current table and candidate before using its entry, restart invalid probes, and extract values under the validated read guard. Do not retain earlier rejected keys or introduce a second per-method probe algorithm. Make cached dictionary hints identity-only, avoiding unrelated key equality and stale values. Reuse the same validated lookup extraction for refreshed hints, so values are cloned before releasing the read guard. Dictionary iterators Share checked state and stepping across keys, values and items in both directions, including reduction snapshots that do not advance or poison the original iterator. Track live remaining elements instead of physical slots, allowing ordinary same-used key replacement while retaining private relocation safeguards. Distinguish sticky size failures from terminal excess-key failures. Clone only projected references under the dictionary/iterator guards, then allocate tuples/errors and release detached dictionary owners outside those guards. Existing set iteration checks remain unchanged. Super namespace lookup Share fallible class-namespace lookup with mapping proxies. Preserve the original query object for heap dictionaries and string-subclass keys, propagate hash/equality errors, and find fresh names inserted into live class dictionaries. Exact-string native lookups retain their map fast path. Snapshot the MRO and release its read lock before dictionary callbacks, then release the owned snapshot before descriptor dispatch or generic fallback. Descriptor owner and instance arguments remain unchanged. Use optional obj.__class__ lookup, correct the missing zero-argument class-cell exception, preserve native type-name prefixes and 200-byte diagnostics, and reject keywords before positional binding through a small preflight around the existing argument binder. Validation Compared against CPython d220409a13b77de7a6c30abe16ea90db01528edc namespaceobject.c, descrobject.c and dictobject.c. External CPython 3.15.0 namespace oracle and independent review passed, including hash callbacks, mutations, rejected mappings, subtype replacement, and finalizer reentry on success/error. Mappingproxy oracle: 94 controls passed. Shared dictionary oracle: 38 controls passed, including deletion, replacement at recycled coordinates, table resize, live value updates, finalizer-before-retry and exception traceback owners. Dedicated independent core review checked probe lifetimes and table validation separately. Ten additional isolated attribute-read oracle groups passed: wrong-hash callbacks are skipped, and key/value mutation, removal, replacement, resize, errors and finalizer reentry produce the current result. Independent hinted-read ownership/lock review passed on the final patch. Dictionary iterator reference coverage: 159 candidate-focused assertions plus 90 independent ownership/reentry assertions passed. Independent source review checked state snapshots, terminal transitions, dictionary ownership, lock scopes and GC traversal. Super reference coverage: 43 original controls, 12 focused diagnostic checks and 48 independent checks passed pinned CPython. Independent source review covered error identity, query controls, namespace/MRO ownership, lock scopes, descriptors, subclass initializers and documented native-snapshot limitations. These are reference results, not native RustPython runtime results. Final composed threaded cargo check passed (1m02s), all-targets Clippy passed (2m09s), and normal commit hooks passed. All twelve baseline diagnostics in host_env/socket, VM POSIX and ElementTree are unchanged; no suppression was added. Limits Native RustPython execution remains unperformed because the required safety guard is not verified. One existing Rust unit-test invocation is mechanically adjusted for the now-infallible hint API; its assertion and expected value are unchanged. No Python tests, test markers, or workflows were modified. Hosted runtime CI remains necessary. Attributes-backed native namespaces still require materialized snapshots. This includes mutable AST namespace views, callbacks changing those namespaces, and union-exposed backing-dictionary identity. Only actual dictionary-backed class namespaces become live; no type-storage redesign is included. For super lookups with callback-bearing queries, a native AST namespace mutation can still leave the materialized snapshot stale and postpone destruction of replaced values. The native exact-string fast path has no Python key callbacks. The read-probe correction uses allocation identity like CPython, not a new mutation-history counter. Same-key clear/reinsert callback counts can depend on allocator reuse; no universal count claim is made for that case. Hinted reads are included; concurrent races after separate mutation lookup/commit phases, including pop/remove_if, remain outside this patch. No broad operation-atomicity or native stress-test claim is made. Existing module-qualification differences in SimpleNamespace replacement rejection diagnostics are also unchanged. Integration: #9681's separate reentrant LRU mutation helpers are unchanged and must remain on composition. Older #6215 instead raises on changed dictionary size; this patch follows CPython restart semantics rather than adopting that behavior. Broad ownership work in #8944/#8939 may require textual reconciliation. Those PRs already include an owned super MRO snapshot; preserve that change when composing. They do not supply the fallible raw namespace/query controls added here. Dictionary iterator limitations: private relocation guards remain conservative for internal compaction. Cached item-result tuple ownership/identity and view-intersection error cleanup remain separately identified follow-ups; this patch does not mutate published tuples or claim those fixes. No concurrent stress/benchmark pass is claimed. Ownership integration detail: #8939/#8944 create AST classes as interpreter-local heap types with real dictionaries. That should remove the specific AST snapshot gap when combined with this lookup helper, but this conclusion is source-only. The new owned dictionary accessor must resolve their interpreter-local namespace before returning it; shared native runtime namespaces should use a real interpreter-owned dictionary. Preserve bootstrap Attributes, stable native identities and registry initialization/GC ordering. Do not attach a runtime dictionary to a process-global native definition or keep a second value-owning Attributes mirror. This integration has not been implemented or compiled in this PR.

Open Graph Description: Summary Group namespace, mapping-proxy, super lookup and dictionary lookup/iterator controls for Python 3.15 in six Rust source files (+441/-456). SimpleNamespace Convert non-exact dictionary inpu...

X Description: Summary Group namespace, mapping-proxy, super lookup and dictionary lookup/iterator controls for Python 3.15 in six Rust source files (+441/-456). SimpleNamespace Convert non-exact dictionary inpu...

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

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:106db452-d4b4-1cfc-6c0b-973566ab939d
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idCB10:4D9F2:1374DC4:19DF1BD:6B01F3A2
html-safe-noncec1ec1869bc9b622855e75c3ae2e903ef7332e589a198610ee26e9f9671da26e7
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQjEwOjREOUYyOjEzNzREQzQ6MTlERjFCRDo2QjAxRjNBMiIsInZpc2l0b3JfaWQiOiI0NzQxNTg1Mjc4ODY1NjM0MjEwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacbf2b28caaf7a6cb662923328d7bfeb8bf358e770581613888facc406d012d684
hovercard-subject-tagpull_request:5156059615
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/9708/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 namespace, mapping-proxy, super lookup and dictionary lookup/iterator controls for Python 3.15 in six Rust source files (+441/-456). SimpleNamespace Convert non-exact dictionary inpu...
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/9708/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FRustPython%2FRustPython%2Fpull%2F9708%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%2F9708%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/9708/files
Reloadhttps://github.com/RustPython/RustPython/pull/9708/files
Reloadhttps://github.com/RustPython/RustPython/pull/9708/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/namespace-controls-20261104https://github.com/youknowdot/RustPython/tree/fix/namespace-controls-20261104
Conversation 3 https://github.com/RustPython/RustPython/pull/9708
Commits 6 https://github.com/RustPython/RustPython/pull/9708/commits
Checks 19 https://github.com/RustPython/RustPython/pull/9708/checks
Files changed https://github.com/RustPython/RustPython/pull/9708/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9708/files
Align namespace, super and dictionary controls https://github.com/RustPython/RustPython/pull/9708/files#top
Show all changes 6 commits https://github.com/RustPython/RustPython/pull/9708/files
082a4be Align SimpleNamespace dictionary and callback controls youknowdot Nov 4, 2026 https://github.com/RustPython/RustPython/pull/9708/commits/082a4be28ea2888a533ee4f4ccf73f80b79993d4
be0a9b8 Align mapping proxy delegation and dictionary read controls youknowdot Nov 4, 2026 https://github.com/RustPython/RustPython/pull/9708/commits/be0a9b869a8c5df925494dee1a81e43abf88ce1b
3950911 Validate hinted dictionary reads through shared lookup youknowdot Nov 4, 2026 https://github.com/RustPython/RustPython/pull/9708/commits/3950911c089e17a36db7051fbf2bd4079b5de9e4
71849b6 Make cached hint lookup infallible youknowdot Nov 4, 2026 https://github.com/RustPython/RustPython/pull/9708/commits/71849b6ad1dc34fec7665c004ad7d14ccebbbf0e
fae9924 Share checked dictionary iterator state and reduction youknowdot Nov 4, 2026 https://github.com/RustPython/RustPython/pull/9708/commits/fae9924cb37eee1d23ca2001c32a020b526503e1
a9b7067 Preserve super namespace callbacks and MRO ownership youknowdot Nov 4, 2026 https://github.com/RustPython/RustPython/pull/9708/commits/a9b70671705149eab78e85a34245a7c543ae93cc
Clear filters https://github.com/RustPython/RustPython/pull/9708/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9708/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9708/files
dict.rs https://github.com/RustPython/RustPython/pull/9708/files#diff-da22219fe05502509c75f7b1ba56079fecf076601f219531bef523705764e68b
mappingproxy.rs https://github.com/RustPython/RustPython/pull/9708/files#diff-55b1556ffbbe2f476dcfa0ecef4cf2299dfb1c0e33f0e44ae85bb7c27232d5f1
namespace.rs https://github.com/RustPython/RustPython/pull/9708/files#diff-793aa2f51995b2c0ec89b409aaa8056b5c3f9ede3f3b0462a426f3af0a49a14a
super.rs https://github.com/RustPython/RustPython/pull/9708/files#diff-55cc28520972e0208b4567bd2afec852006899f7f1353afcf694931270b03077
type.rs https://github.com/RustPython/RustPython/pull/9708/files#diff-fb88962f9343ca7b8d31bfe34f5063136575e05eadae6fccb3b64658e14b0d6c
dict_inner.rs https://github.com/RustPython/RustPython/pull/9708/files#diff-aa3e0344e8fe84f229558c441057af178d20ee5bb19fda4bc01485a9a62bf99e
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9708/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9708/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.