GeezerVison is showing github.com — Share typing representation and GenericAlias controls by youknowdot · Pull Request #9711 · RustPython/RustPython
Conversation
youknowdot
commented
Nov 4, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Summary
Align GenericAlias controls and share the Python 3.15 type-representation writer across GenericAlias, Union and constant annotation evaluators. The combined change spans three Rust files (+163/-182).
- Release the iterator's mutex before constructing its starred alias or dropping the original owner, so subclass finalizers can reenter the exhausted iterator.
- Preserve raw tuple-subclass equality results and CPython's inequality handling. Reconstruct the actual GenericAlias subtype in reduce/copy/pickle paths.
- Replace three divergent type formatters with one WTF-8 writer. Preserve optional-attribute lookup errors and short-circuits, non-string names, surrogate characters, and temporary-owner cleanup. Attribute probes release their values before the next callback.
- Preserve the public writer's extra
__str__ call on returned str subclasses, after name-attribute cleanup. This call can change output or raise and must not be replaced with raw string copying.
- Match annotation tuple formatting, including
(int) for a singleton tuple, and preserve Unicode in ConstEvaluator's own repr and Union's subclassing diagnostic.
Validation
Pinned reference: CPython d220409a13b77de7a6c30abe16ea90db01528edc, including typevarobject.c, genericaliasobject.c and unicode_writer.c.
- Independent source/ownership review passed. The expanded independent oracle passed 36 groups, a separate focused oracle passed 18 groups, and the previous 10 GenericAlias groups still passed. These are external CPython reference checks, not native RustPython runtime results.
- Final threaded cargo check passed (1m07s) and all-targets Clippy passed (2m21s), with exactly the same 12 existing baseline diagnostics and no new warnings.
- Rustfmt, diff checks and normal commit hooks passed without bypass.
Limits and integration
Native RustPython execution remains unperformed because its required safety guard is not verified; hosted runtime CI remains necessary. The separate non-threaded/WASM graph and full workspace/C-API test suite were not run under the current disk constraint. No repository tests, markers, Lib files or workflows changed.
#9714 separately fixes Union construction and comparison; #9687 fixes TypeAliasType constructor binding; #9700 changes qualified-name diagnostics. Exact-source composition with those changes was clean and reviewed, but the combined branches were not compiled. Broader payload ownership work in #8944/#8939 may require textual reconciliation and does not implement these controls.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Assisted-by: OpenAI Codex:model version not exposed
coderabbitai
Bot
commented
Nov 4, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|

Caution
Review failed
The pull request is closed.
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
Share
-
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Use one writer for aliases, unions, and constant annotations while preserving Unicode, returned string callbacks, and temporary owner order.
Assisted-by: OpenAI Codex:model version not exposed
youknowdot
changed the title
Align GenericAlias controls and iterator ownership
Share typing representation and GenericAlias controls
Nov 4, 2026
Override the existing rich comparison slot through Comparable, preserving raw equality results and identity-based inequality. Retain a bool-valued cmp adapter for Rust callers without duplicating comparison logic.
Assisted-by: OpenAI Codex:model version not exposed
Uh oh!
There was an error while loading. Please reload this page.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|