xdis.std.Instruction should not take "has_arg" parameter #86
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 371
- Forks
- 106
- PR merge metrics
- No merged PRs in 30d
Description
Although we want has_stdarg in the underlying bytecode instruction, in in std.Instruction() it shouldn't be passed as a parameter but computed based on the opc, e.g. has_arg = opname >= opc.HAVE_ARGUMENT.
In an ideal world, fields argrepr and opname wouldn't need to be passed in std.Instruction(). We could either create another function or have setting these to be None to mean that they get filled in. And opname probably should be checked against opcode.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at xdis.std.Instruction and inspect how has_stdarg, has_arg, argrepr, opname, and opcode are represented; compare the current argument handling with opc.HAVE_ARGUMENT. Consider how omitted argrepr and opname should be filled and how opname should be checked against opcode. Done means the Instruction interface no longer requires has_arg and the requested consistency checks and defaults are covered.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- compilers, devtools
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100