⚡ Sangsakala Proxy 🏠 Home
Skip to content

Align Union construction and callback controls - #9714

Draft
youknowdot wants to merge 1 commit into
RustPython:mainfrom
youknowdot:fix/union-controls-20261104
Draft

youknowdot wants to merge 1 commit into
RustPython:mainfrom
youknowdot:fix/union-controls-20261104

Conversation

@youknowdot

Copy link
Copy Markdown
Contributor

Summary

  • Build Union arguments through one streaming builder, preserving checked typing construction separately from unchecked type/GenericAlias operators. Subscription uses exact-tuple unpacking; substitution validates directly without invoking user __or__ or __ror__.
  • Preserve creation-time hashable/unhashable partitions for equality and hashing. Freeze stored set entries without repeating hash or collision callbacks, and preserve identity shortcuts and containment comparison direction.
  • Preserve callback errors and ownership: only the initial hash failure classifies an argument as unhashable; subsequent hash failures use the shared contextual formatter while comparison exceptions remain unchanged. Keep original inputs alive and release failed-builder lists in reverse order.

Validation

  • Independent source/ownership review and 19 pinned CPython 3.15 oracle groups passed, covering callback order, exception identity, temporary lifetimes, partition equality and checked-entry-point differences.
  • Final threaded cargo check passed for host_env, VM and stdlib. Threaded all-targets Clippy passed with exactly the same 12 existing diagnostics as the baseline and no new warning.
  • Rustfmt, git diff --check, and normal commit hooks passed.

Native RustPython execution is not available under the required safety guard; no native runtime or full test-suite pass is claimed. The separate non-threaded/WASM graph was not built under the current disk limit.

Integration notes

The shared dictionary hash-error formatter extraction is intentionally identical to the helper in #9693 rather than another implementation. Its set operation changes still require reconciling add/add_known_hash: preserve #9693's hash-only contextualization, keep raw collision errors unchanged, and delegate to one raw insertion helper. The formatter also overlaps #9700's Unicode-preserving key_hash change: retain the extracted WTF-8 helper and #9700's other qualified-name improvements. Source composition was inspected; the combined branches have not been compiled.

Union/GenericAlias representation formatting and unrelated set-operation behavior remain outside this change. Repository tests, standard-library files and workflows are unchanged.

Share checked and unchecked construction while preserving cached partitions, hash failures, and temporary argument ownership.

Assisted-by: OpenAI Codex:model version not exposed
@coderabbitai

coderabbitai Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant