Skip to content

Commit

Permalink
fix: avoid raising an exception inside testing tuple structure for a …
Browse files Browse the repository at this point in the history
…custom type
  • Loading branch information
autumnjolitz committed Jul 16, 2024
1 parent 827bd31 commit bd4ce81
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 bd4ce81

Please sign in to comment.