Title: Align type layouts and generic descriptors with Python 3.15 by youknowdot · Pull Request #9175 · RustPython/RustPython · GitHub
Open Graph Title: Align type layouts and generic descriptors with Python 3.15 by youknowdot · Pull Request #9175 · RustPython/RustPython
X Title: Align type layouts and generic descriptors with Python 3.15 by youknowdot · Pull Request #9175 · RustPython/RustPython
Description: Align type layouts and generic descriptors with Python 3.15 Split from #8954, based directly on main. This is a coherent native type-layout change with its complete canonical descriptor-test closure. Changes Permit named slots on tuple subclasses and special dict/weakref slots on supported variable-sized bases. Distinguish __bases__ reparenting from strict __class__ assignment checks, preserving allocated storage and the existing member-layout safeguards. Share object-owned generic __dict__ and __weakref__ descriptors within each interpreter, using existing descriptor ownership/traversal and storage checks. Reject a selected metaclass with no constructor slot and align special type-attribute validation. Import full test_descr.py from CPython 3.15.0 d220409a13 through scripts/update_lib, preserving the two existing RustPython expectedSuccess wrappers. No new guards or test-logic edits. Preserves merged annotation/cache lifetime fixes from #9162 and layout safeguards from #9041. Does not depend on the separate weakref-lifecycle, lazy-import or startup-path PRs. Validation Normal commit hooks pass. Fresh locked/offline release build passes. Pinned CPython oracle: 168 tests total, 165 pass, one CPU-resource skip, two canonical expected failures. RustPython full canonical descriptor suite: 168 total, 155 pass, 13 canonical skips, no failures or expected failures. New tuple/special-slot, shared-descriptor and base-assignment cases execute successfully. Workspace native: 1,369 passed. C-API native: 123 passed, four existing ignored tests. Strict Clippy passes for both workspace and separate C-API configurations. Compiler-only nonthread check passes. Workspace doctests: 24 passed, 18 ignored. C-API doctests: zero tests, successful completion. Related existing suites: tuple 34 passed/4 skipped; class 33 passed/4 skipped; super 40 passed; types 132 passed/2 skipped/2 expected failures. All existing guards preserved. The missing _testcapi fixtures leave the null-constructor metaclass and before-items C-extension storage paths without candidate runtime coverage. They are not reported as passing. Local validation was on Linux with the default filesystem-library backend; hosted platform results are pending. Default resources are used; the million-wrapper CPU stress test remains canonically resource-gated. Each runtime uses bounded owned-process cleanup and a private library/temp environment. Source and artifact hashes reconcile; generated bytecode is hash-preserved separately. One oracle-to-build audit command initially used an incorrect relative path, so its full post-oracle audit completed immediately after build launch; it found no changes. The build's own sealed-source and zero-cache preflight succeeded before launch. AI assistance OpenAI Codex assisted with extraction, source review, canonical migration, validation and this description. Model version was unavailable. Independent source, effects and artifact reviews were performed; remaining coverage limits are disclosed above. Summary by CodeRabbit Bug Fixes Improved validation when changing a class’s base classes or assigning __class__, including checks for compatible memory layout and dictionary or weak-reference support. Tuple subclasses can now define named slots, while unsupported slot layouts continue to raise errors. Accessing __weakref__ on instances without weak-reference support now raises AttributeError. Invalid metaclass selection now raises TypeError when the winning metaclass has no __new__ method.
Open Graph Description: Align type layouts and generic descriptors with Python 3.15 Split from #8954, based directly on main. This is a coherent native type-layout change with its complete canonical descriptor-test closur...
X Description: Align type layouts and generic descriptors with Python 3.15 Split from #8954, based directly on main. This is a coherent native type-layout change with its complete canonical descriptor-test closur...
Opengraph URL: https://github.com/RustPython/RustPython/pull/9175
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:d1959b28-81e2-885d-a02e-92ba1bede741 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 8C72:11EACE:3496BE4:4633ECD:6B01FE9C |
| html-safe-nonce | f998211ba204e230b5d05a57092e473465b5b24ee5fc82a7025bb054efe4a865 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QzcyOjExRUFDRTozNDk2QkU0OjQ2MzNFQ0Q6NkIwMUZFOUMiLCJ2aXNpdG9yX2lkIjoiMjQxOTg5Nzk4MDY3ODE3NjQxMiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | dd3d949ba3dfe22ec3ab63e2daa4a0a14dd2ad26e4be7bdd36839ef1748dce0a |
| hovercard-subject-tag | pull_request:4900427242 |
| 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/9175/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 | Align type layouts and generic descriptors with Python 3.15 Split from #8954, based directly on main. This is a coherent native type-layout change with its complete canonical descriptor-test closur... |
| 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