Skip to content

Commit

Permalink
Check for the __len__ attribute instead of checking if it isn't Array…
Browse files Browse the repository at this point in the history
…Like. This should be more general and satisfy python3.9
  • Loading branch information
CangyuanLi committed Nov 13, 2023
1 parent c26f736 commit 9b3ec96
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pyethnicity/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def _assert_equal_lengths(*inputs: Union[object, ArrayLike]):
lengths = []

for input in inputs:
if not isinstance(input, ArrayLike) or isinstance(input, str):
if not hasattr(input, "__len__") or isinstance(input, str):
input = [input]

lengths.append(len(input))
Expand Down

0 comments on commit 9b3ec96

Please sign in to comment.