Skip to content

Preserve raw mappingproxy rich-comparison results - #9039

Merged
youknowone merged 1 commit into
RustPython:mainfrom
youknowdot:fix-mappingproxy-comparison-result
Oct 10, 2026
Merged

youknowone merged 1 commit into
RustPython:mainfrom
youknowdot:fix-mappingproxy-comparison-result

Conversation

@youknowdot

Copy link
Copy Markdown
Contributor

Return the wrapped mapping's rich-comparison result without converting it to bool. This preserves arbitrary result objects for all six mappingproxy comparisons, as in CPython 3.14.

Extracted from #8954 without its Python 3.15 ordering restrictions, defensive copies, or frozendict dependencies. The existing mappingproxy snippet covers direct and reflected comparisons, result identity, and unwanted truth conversion.

Validation:

  • CPython 3.14.7 passes the snippet. The pre-fix RustPython baseline triggers the result object's deliberately raising __bool__.
  • All 14 existing canonical MappingProxyTests pass on the baseline.
  • Normal pre-commit hooks and VM Clippy pass.
  • Patched native runtime and aggregate tests await CI; local runtime linking is blocked by available disk space.

AI-assisted implementation, tests, and review with OpenAI Codex. Kept as a draft for CI and maintainer review.

Extract the Python 3.14 comparison contract from RustPython#8954 without its 3.15 ordering restrictions or defensive copies. Return the wrapped mapping comparison result without truth conversion. Cover all six direct and reflected operations in the existing mappingproxy snippet.

Assisted-by: OpenAI Codex:model identifier unavailable
@coderabbitai

coderabbitai Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: Repository: RustPython/RustPython/.coderabbit.yml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 09fdc220-8b92-4f4f-a829-4acd6bf41288

📥 Commits

Reviewing files that changed from the base of the PR and between 3af5f8a and 1d1c682.


📒 Files selected for processing (2)
  • crates/vm/src/builtins/mappingproxy.rs
  • extra_tests/snippets/builtin_mappingproxy.py

 __________________________________________________
< I want to be a VS Code extension when I grow up. >
 --------------------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

  • 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

Comment @coderabbitai help to get the list of available commands.

@youknowone
youknowone marked this pull request as ready for review October 10, 2026 10:33
@youknowone
youknowone merged commit 5dba000 into RustPython:main Oct 10, 2026
21 checks passed
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-10T10:37:28.545713Z 1d1c682 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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.

2 participants