Repository navigation
Reuse stored dict hashes when merging call keywords - #9053
Conversation
Assisted-by: OpenAI Codex:model identifier unavailable
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to No actionable merge-blocking issue is identified. Complete the pending CI checks before merging. Pre-merge checks |
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 749e4ca244
ℹ️ 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".
| f(1,2,3,4,5,6) | ||
|
|
||
|
|
||
| def test_keyword_dict_stored_hashes(): |
There was a problem hiding this comment.
Remove the newly added test body
This function adds test logic, test data, and assertions to an existing test file, but this repository explicitly limits test-file edits to adding expected-failure decorators or removing those decorators and their TODOs. This addition therefore cannot land under the repository's test-modification policy; remove it or obtain an explicit policy exception before landing.
AGENTS.md reference: AGENTS.md:L273-L279
Useful? React with 👍 / 👎.
Summary
Extract the exact-dict keyword-merge cached-hash path from #8954 (
43065e79ddc46eafeca58cb39398ac007b5d25f7) onto Python 3.14 main (3af5f8a15314446d2b28a90e429c938dc7b8beeb).Snapshot each key, value and stored hash under one read lock, then use the existing fallible known-hash containment/insertion helpers after unlocking. Expanding an exact dictionary into a call must not invoke its keys'
__hash__again during this merge. Equality errors such asRuntimeErroralso reach Python instead of the old containment unwrap.The exact-dict guard, mapping fallback, snapshot order and duplicate detection stay in place. Only crate-private snapshot accessors are added. References: CPython 3.14.7 DICT_MERGE and stored-hash dictionary merge.
Merged #8858 covers other dictionary hash-reuse paths, not frame.rs. Merged #8957 covers native keyword dispatch. Both remain intact, and open #8951 does not contain this extraction.
Validation
syntax_function_args.pysnippet; its native pytest entry passes.test_extcalldoctest passes unchanged.This is stored-hash reuse, not a rewrite of every kwargs error or mutation rule. Existing snapshot-versus-live-source differences remain. CPython specially formats equality-raised AttributeError and single-argument KeyError; this narrow path propagates them directly instead of the previous panic, and complete formatter parity remains separate work. No canonical tests, README wording, implementation-name guards or Rust behavioral tests changed.
Local validation is bounded Linux validation, not a complete workspace or cross-platform claim. Full hosted CI is pending; this remains a draft for review.
AI-assisted implementation and validation with OpenAI Codex; model identifier unavailable. No human review is implied.
Summary by CodeRabbit
TypeError, while errors raised during key comparison are preserved.