Implement code object __eq__/__hash__ · RustPython/RustPython@d2d2822 · GitHub
Skip to content

Commit d2d2822

Browse files
committed
Implement code object __eq__/__hash__
- Add Comparable and Hashable traits for PyCode - Compare by name, args, flags, bytecode, consts, names, vars, linetable - Hash by tuple of key attributes matching CPython's code_hash - Remove unused custom_ops slice in Instruction::try_from - Add co_lnotab intentional non-implementation comment
1 parent 47c2acd commit d2d2822

2 files changed

Lines changed: 75 additions & 6 deletions

File tree

crates/compiler-core/src/bytecode/instruction.rs

Lines changed: 0 additions & 4 deletions

crates/vm/src/builtins/code.rs

Lines changed: 75 additions & 2 deletions

0 commit comments

Comments
 (0)