Skip to content
This repository was archived by the owner on Sep 8, 2025. It is now read-only.

Commit 5e6d607

Browse files
committed
ABC: return same from OpcodeAPI's as_opcode() as from Opcode.
99.99% cargo-culting. I don't understand the purpose of this structuring, but the function signatures don't match, and this is the only permutation I could find between OpcodeAPI, Opcode and FRONTIER_OPCODES that stops producing an error when running `mypy`: eth/vm/opcode.py:40: error: Return type "Opcode" of "as_opcode" incompatible with return type "Type[Opcode]" in supertype "OpcodeAPI" This commit has been cherry-picked from previous PR: 07b4398
1 parent 823c145 commit 5e6d607

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

eth/abc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -886,9 +886,9 @@ def __call__(self, computation: 'ComputationAPI') -> None:
886886
def as_opcode(cls: Type[T],
887887
logic_fn: Callable[['ComputationAPI'], None],
888888
mnemonic: str,
889-
gas_cost: int) -> Type[T]:
889+
gas_cost: int) -> T:
890890
"""
891-
Class factory method for turning vanilla functions into Opcode classes.
891+
Class factory method for turning vanilla functions into Opcodes.
892892
"""
893893
...
894894

0 commit comments

Comments
 (0)