Title: Accept dict subclasses as warning module globals by youknowdot · Pull Request #9062 · RustPython/RustPython · GitHub
Open Graph Title: Accept dict subclasses as warning module globals by youknowdot · Pull Request #9062 · RustPython/RustPython
X Title: Accept dict subclasses as warning module globals by youknowdot · Pull Request #9062 · RustPython/RustPython
Description: Current revision Targets main after #8950, with one logical commit: f9e7dd2f13900012883b8f3a2c583fcaf60f84cf (parent 06007c81fa99e813cbf4583dab326764ba0ef017). The consolidated commit has exactly the same source tree as the prior reviewed head; original author attribution and assistance trailers are retained. No files under Lib/ are changed. Normal hooks, whitespace checks, and independent tree/history review passed. The temporary [skip ci] marker is removed and normal CI is enabled for this final head. No new local build or runtime test is claimed. Validation recorded below belongs to earlier revisions unless explicitly stated otherwise. Summary Extract Python 3.14-compatible dict-subclass support for warn_explicit(module_globals=...) from #8954. Accept actual dict subclasses, while retaining the current diagnostics for other objects. Read __name__ from stored dictionary data rather than invoking subclass __getitem__ or __missing__. The loader helper still intentionally calls overridable .get for __loader__ and __spec__. The second change is a necessary correction to the mega implementation: widening the gate alone would expose the wrong lookup behavior. No frozendict dependency, 3.15 error wording, category changes, or warning-state redesign is included. Reference sources: CPython 3.14.7 warning gate and source lookup, loader blessing helper. Provenance and overlap Source mega #8954 at 43065e79ddc46eafeca58cb39398ac007b5d25f7. Based on main 02917b6d9ca73257d081ca9e2af4ecf88d185e7e, preserving merged #9034 category behavior. Current open-PR filename/source audit found no duplicate. #8951 only overlaps unrelated warning context setup; #8944/#8939 change warning-state ownership/import access, not this gate or name lookup. Validation Independent source review and normal commit hooks passed. Native baseline rejects the new dict-subclass regression; the candidate passes. Exact CPython 3.14.7 and native RustPython pass the complete updated warnings snippet. The existing initial warning output is unchanged. Twelve unchanged canonical cases pass: CFilterTests.test_module_globals and all eleven CWarnTests.test_gh86298_* loader cases. The appended regression covers loader access order and present/absent stored names with raising item/missing overrides, using an in-memory loader. Four snippet pytest entries passed (warnings and warning-keywords, both interpreters). VM and CAPI Clippy with -D warnings passed. The full workspace suite was not run locally; no existing assertions or markers were weakened.
Open Graph Description: Current revision Targets main after #8950, with one logical commit: f9e7dd2f13900012883b8f3a2c583fcaf60f84cf (parent 06007c81fa99e813cbf4583dab326764ba0ef017). The consolidated commit has exactly t...
X Description: Current revision Targets main after #8950, with one logical commit: f9e7dd2f13900012883b8f3a2c583fcaf60f84cf (parent 06007c81fa99e813cbf4583dab326764ba0ef017). The consolidated commit has exactly t...
Opengraph URL: https://github.com/RustPython/RustPython/pull/9062
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,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-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:9725ba92-59bc-4f3d-83a7-4236823f6fa0 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 95F0:38C5CF:3EC7A62:4F9862B:6B01F3AD |
| html-safe-nonce | 29bb491c51dc32767bc5a884887fbcc74f386c2ecfc9953c77aff2a73889f905 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NUYwOjM4QzVDRjozRUM3QTYyOjRGOTg2MkI6NkIwMUYzQUQiLCJ2aXNpdG9yX2lkIjoiMjQyNjE4NzE2NTcxNDIxNTg1MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 1621366771b2a26da74713b84c060d6f1c729352a36912c504d0b80f466fdef5 |
| hovercard-subject-tag | pull_request:4811017227 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/RustPython/RustPython/pull/9062/files |
| twitter:image | https://avatars.githubusercontent.com/u/336763669?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/336763669?s=400&v=4 |
| og:image:alt | Current revision Targets main after #8950, with one logical commit: f9e7dd2f13900012883b8f3a2c583fcaf60f84cf (parent 06007c81fa99e813cbf4583dab326764ba0ef017). The consolidated commit has exactly t... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/RustPython/RustPython git https://github.com/RustPython/RustPython.git |
| octolytics-dimension-user_id | 39710557 |
| octolytics-dimension-user_login | RustPython |
| octolytics-dimension-repository_id | 135201145 |
| octolytics-dimension-repository_nwo | RustPython/RustPython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 135201145 |
| octolytics-dimension-repository_network_root_nwo | RustPython/RustPython |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width