diff --git a/tests/fixtures/wrapper/sample.py b/tests/fixtures/wrapper/sample.py index e9ff6726a..30faf9dc1 100644 --- a/tests/fixtures/wrapper/sample.py +++ b/tests/fixtures/wrapper/sample.py @@ -4,10 +4,10 @@ obj = Wrapper( alpha='ααα', - bravo=[ + bravo=iter([ 1, 2, - ], + ]), charlie=[ Charlie( value='δδδ', diff --git a/xsdata/utils/collections.py b/xsdata/utils/collections.py index 0bdc1bff6..ab1e8ec3b 100644 --- a/xsdata/utils/collections.py +++ b/xsdata/utils/collections.py @@ -3,6 +3,7 @@ Any, Callable, Dict, + Generator, Iterable, Iterator, List, @@ -20,7 +21,7 @@ def is_array(value: Any) -> bool: if isinstance(value, tuple): return not hasattr(value, "_fields") - return isinstance(value, (list, set, frozenset)) + return isinstance(value, (list, set, frozenset, Generator)) def unique_sequence(items: Iterable[T], key: Optional[str] = None) -> List[T]: