Skip to content

Commit

Permalink
recursively validate tuples instead of simple containment checking
Browse files Browse the repository at this point in the history
  • Loading branch information
sneakers-the-rat committed Dec 14, 2024
1 parent 22341c8 commit e942da4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/numpydantic/validation/dtype.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def validate_dtype(dtype: Any, target: DtypeType) -> bool:
return True

if isinstance(target, tuple):
valid = dtype in target
valid = any(validate_dtype(dtype, target_dt) for target_dt in target)
elif is_union(target):
valid = any(
[validate_dtype(dtype, target_dt) for target_dt in get_args(target)]
Expand Down

0 comments on commit e942da4

Please sign in to comment.