Skip to content

Represent OrderedDict views with their contents - #9038

Merged
youknowone merged 1 commit into
RustPython:mainfrom
youknowdot:fix-ordereddict-view-repr
Oct 10, 2026
Merged

youknowone merged 1 commit into
RustPython:mainfrom
youknowdot:fix-ordereddict-view-repr

Conversation

@youknowdot

Copy link
Copy Markdown
Contributor

Give OrderedDict keys, values, and items views their Python 3.14 representations, including contents and insertion order. Snapshot elements before calling their repr methods and preserve recursive-view handling.

Extracted from #8954 without its mapping/frozendict migration. One regression block in the existing collections snippet covers empty/populated views, recursion, mutation during repr, and repr exceptions.

Validation:

  • CPython 3.14.7 passes the snippet. The pre-fix baseline fails the first view-repr assertion.
  • The previously built isolated candidate passes focused runtime and canonical tests; this is historical validation, not a fresh current-main build.
  • Normal pre-commit hooks and current-main VM Clippy pass.
  • Current-head 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-compatible view representation from RustPython#8954. Snapshot view elements before invoking their repr methods, preserve recursion handling, and cover each view in the existing collections snippet. Leave migration-specific mapping changes out.

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: e830a104-3ebf-42d6-b3a9-300014c508f1

📥 Commits

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


📒 Files selected for processing (2)
  • crates/vm/src/stdlib/_collections/ordered_dict.rs
  • extra_tests/snippets/stdlib_collections.py

 _______________________________________________
< Show me the code! And I'll show you the bugs. >
 -----------------------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).
✨ 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:32
@youknowone
youknowone merged commit b725188 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:26.543951Z f974c11 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f974c11161

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".



# OrderedDict views show their contents in insertion order, including recursion.
def check_ordered_dict_view_repr():

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Remove the prohibited snippet test changes

This block adds a new test function and multiple assertions to extra_tests/snippets/stdlib_collections.py, but the repository's test-code policy explicitly disallows changes to test assertions or logic and says the only permitted test-file edits are expected-failure decorator changes. Revert this added test block before merging.

AGENTS.md reference: AGENTS.md:L275-L279

Useful? React with 👍 / 👎.

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