Make mismatched arity error easier to parse (#7118) Makes parsing mismatched arity errors easier for large inputs by calling out the discrepancy up front.
diff --git a/bindings/python/iree/runtime/function.py b/bindings/python/iree/runtime/function.py index f42a4fa..d641cc8 100644 --- a/bindings/python/iree/runtime/function.py +++ b/bindings/python/iree/runtime/function.py
@@ -496,8 +496,8 @@ descs = [None] * len(py_list) elif len(py_list) != len(descs): _raise_argument_error( - inv, f"mismatched function call arity: " - f"expected={descs}, got={py_list}") + inv, f"mismatched call arity: expected {len(descs)} arguments but got " + f"{len(py_list)}. Expected signature=\n{descs}\nfor input=\n{py_list}") for py_value, desc in zip(py_list, descs): inv.current_arg = py_value inv.current_desc = desc