From d82ef1ef840332de319458099e239553a642c6f1 Mon Sep 17 00:00:00 2001 From: Autumn Date: Tue, 16 Jul 2024 11:33:31 -0700 Subject: [PATCH] [typedef] avoid raising an exception inside testing tuple structure --- instruct/typedef.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/instruct/typedef.py b/instruct/typedef.py index 6e86ac9..07541e6 100644 --- a/instruct/typedef.py +++ b/instruct/typedef.py @@ -961,10 +961,9 @@ def test_func_heterogenous_tuple(value): if not isinstance(value, container_cls): return False if len(value) != len(test_types): - raise ValueError(f"Expecting a {len(test_types)} value tuple!") + return False for index, (item, item_type) in enumerate(zip(value, test_types)): if not isinstance(item, item_type): - # raise TypeError(f"{item!r} at index {index} should be a {item_type}") return False return True