Repository navigation
Align object reduction and state callback controls - #9716
Draft
youknowdot wants to merge 1 commit into
Draft
youknowdot wants to merge 1 commit into
youknowdot wants to merge 1 commit into
Conversation
Preserve signed protocol arguments, dynamic state dispatch, original slot keys, and newargs ownership through shared lookup and conversion paths. Assisted-by: OpenAI Codex:model version not exposed
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Align object reduction and state callback controls with Python 3.15 in one production Rust file (+186/-128).
__getstate__lookup. Use the native default fast path only for the original implementation bound to the same receiver; retain instance overrides, foreign-bound methods, lookup errors and callback ownership.Existing binding, lookup, dictionary and method primitives are reused. No per-function keyword parser, test, Lib or workflow edits are introduced.
Validation
Compared with pinned CPython object reduction/state. The 29-case reference oracle reproduced exactly. Independent source review and additional safe failure, copyreg, class-mutation, slot-finalizer and temporary-protocol probes passed. Ordinary classes/subclasses and legal class reassignment were used; no malformed native layouts or unsafe cycles were exercised.
These are CPython reference results and source review, not a RustPython runtime pass. Native RustPython execution, full workspace/C-API suites and separate cross-platform graphs remain unperformed; hosted CI is required.
Limits and integration
Generic nested tuple member destruction still differs from CPython's reverse order. This patch fixes the changed top-level owners but does not redesign generic tuple teardown or claim full nested-container finalizer parity.
Fresh relevant PR patches were checked and do not duplicate this group. Composing with #9715 requires resolving the object.rs import hunk by retaining both its
PyAnyDictimport and this patch's native-function/method-descriptor imports. The directory and reduction behavior hunks are separate; combined execution is not claimed. Preserve the independent ownership/type-name work in #8939/#8944/#9700 and nearby #8848 length-access changes.AI-assisted implementation and independent review using OpenAI Codex; model version is not exposed.
Final validation: threaded host-env/VM/stdlib cargo check passed in 1m12s and all-targets Clippy in 3m03s. Diagnostics exactly match the 12 unchanged baseline warnings. Normal repository commit hooks passed; no suppressions or unrelated baseline edits.