From 6651fa4acc159b967129dcc6c7a554f872a8a913 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Mon, 3 Oct 2022 15:00:44 -0400 Subject: [PATCH] hint clvm_tools.binutils.disassemble() (#90) * hint clvm_tools.binutils.disassemble() --- clvm_tools/binutils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/clvm_tools/binutils.py b/clvm_tools/binutils.py index be611f1f..3a5c56c0 100644 --- a/clvm_tools/binutils.py +++ b/clvm_tools/binutils.py @@ -1,7 +1,9 @@ import string +from typing import Dict from clvm import KEYWORD_FROM_ATOM, KEYWORD_TO_ATOM from clvm.casts import int_from_bytes, int_to_bytes +from clvm.SExp import SExp from ir.reader import read_ir from ir.writer import write_ir @@ -80,7 +82,7 @@ def disassemble_to_ir(sexp, keyword_from_atom, allow_keyword=None): return sexp.to((type_for_atom(as_atom), as_atom)) -def disassemble(sexp, keyword_from_atom=KEYWORD_FROM_ATOM): +def disassemble(sexp: SExp, keyword_from_atom: Dict[bytes, str] = KEYWORD_FROM_ATOM) -> str: symbols = disassemble_to_ir(sexp, keyword_from_atom=keyword_from_atom) return write_ir(symbols)