Skip to content

Commit

Permalink
[typedef] avoid raising an exception inside testing tuple structure
Browse files Browse the repository at this point in the history
  • Loading branch information
autumnjolitz committed Jul 16, 2024
1 parent 827bd31 commit d82ef1e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions instruct/typedef.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit d82ef1e

Please sign in to comment.