Remove BEFORE_WITH,BINARY_SUBSCR#6822
Conversation
📝 WalkthroughWalkthroughThis PR aligns RustPython's bytecode with CPython 3.14 by removing custom opcodes (BeforeWith, BeforeAsyncWith, BinarySubscr, BuildConstKeyMap), introducing a SpecialMethod enum for explicit context-manager method resolution, and unifying subscripting into BinaryOperator::Subscr across compilation and runtime execution. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~40 minutes The changes span multiple compilation pipeline layers with significant structural modifications: removal of public opcodes, introduction of new enum types, updates to codegen emission patterns, and corresponding runtime execution changes. Verification requires checking consistency across codegen, bytecode representation, and VM execution paths. Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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. Comment |
Sorry, something went wrong.
📦 Library DependenciesThe following Lib/ modules were modified. Here are their dependencies: Click to expand dependency informationLegend:
|
Sorry, something went wrong.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@crates/vm/src/frame.rs`:
- Around line 1234-1267: Update the user-facing TypeError message in the
Instruction::LoadSpecial handling so it uses "missing" instead of "missed":
locate the vm.new_type_error call inside the LoadSpecial match arm (in frame
handling where get_special_method returns None) and change the message string to
"'{}' object does not support the context manager protocol (missing {} method)"
to correct the grammar.
Sorry, something went wrong.
a7f2351
into
RustPython:main
Jan 20, 2026
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.