Update `opcode` from 3.13.7 by ShaharNaveh · Pull Request #6156 · RustPython/RustPython
Repository navigation
Update opcode from 3.13.7 - #6156
Merged
youknowone merged 16 commits into RustPython:main from ShaharNaveh:update-opcode Oct 5, 2025
Merged
Update opcode from 3.13.7 #6156
youknowone merged 16 commits into
RustPython:main from
ShaharNaveh:update-opcode
Conversation
ShaharNaveh commented Sep 17, 2025
Copy link Copy Markdown
Contributor
No description provided.
ShaharNaveh added 10 commits September 17, 2025 10:53
Update opcode from 3.13.7
fb44bc9
Base _opcode
f14e623
Add test__opcode.py from 3.13.7
12aea60
Impl has_* methods
16b4eda
Add more methods
7fe1032
Update dis.py from 3.13.7
b5b7534
Update support/bytecode_helper.py from 3.13.7
45ab229
correct is_valid
4224563
Patch failing tests
af92d55
Unpatch support/__init__.py
aa02f02
coderabbitai
Bot
commented
Sep 17, 2025
·
edited
Loading
Copy link Copy Markdown
Contributor
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the
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. ❤️ ShareComment |
clippy
f629c7f
Make comments to doc
56a0edb
impl _varname_from_oparg for code
6b3c578
Unmark passing tests
2634c5f
Revert changes to dis
98abe59
Mark failing tests
a7b9356
ShaharNaveh
changed the title
Impl _opcode. Update dis from 3.13.7
Update opcode from 3.13.7
Sep 18, 2025
ShaharNaveh
marked this pull request as ready for review
September 18, 2025 14:53
ShaharNaveh
requested a review
from youknowone
September 18, 2025 14:53
youknowone
reviewed
Sep 20, 2025
View reviewed changes
Comment thread stdlib/src/opcode.rs
| Self::is_valid(opcode) | ||
| && matches!( | ||
| opcode, | ||
| 63 | 66 |
youknowone commented Sep 20, 2025
Copy link Copy Markdown
Member
|
finally we get |
View reviewed changes
Comment thread Lib/_opcode_metadata.py
| 'INSTRUMENTED_POP_JUMP_IF_FALSE': 251, | ||
| 'INSTRUMENTED_POP_JUMP_IF_NONE': 252, | ||
| 'INSTRUMENTED_POP_JUMP_IF_NOT_NONE': 253, | ||
| 'JUMP': 256, |
| Self::is_valid(opcode) | ||
| && matches!( | ||
| opcode, | ||
| 63 | 66 |
ShaharNaveh commented Sep 25, 2025 · edited Loading
Copy link Copy Markdown
Contributor
Author
|
For some reason I can't comment on the thread of #6156 (comment) so answering it here:
Yes! it also makes it easier for writing the helpers of:
but that wouldn't be needed as I intend #6174 to generate those automatically (just like CPython does it)
Well, yes you could. but I thought that we could have an API that looks similar to this: // This is inside the `_opcode` module
fn has_arg(opcode: i32) -> bool {
Instruction::try_from(opcode).map_or(false, |v| !v.is_pseudo() && v.has_arg())
}
where:
are all auto generated. |
View reviewed changes
youknowone left a comment
Copy link Copy Markdown
Member
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more .
Looks good in general.
I am worrying about the newly introduced magic numbers. I wish it could be quickly resolved in next patch
youknowone merged commit3a6fda4
into
RustPython : main
Oct 5, 2025
ShaharNaveh commented Oct 5, 2025
Copy link Copy Markdown
Contributor
Author
I'll send a quick patch to resolve it in the next couple of days |