Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ History
(`#217 <https://github.com/python-attrs/cattrs/issues/217>`_)
* Fix structuring of ``enum.Enum`` instances in ``typing.Literal`` types.
(`#231 <https://github.com/python-attrs/cattrs/pull/231>`_)
* Fix unstructuring all tuples - unannotated, variable-length, homogenous and heterogenous - to `list`.
(`#226 <https://github.com/python-attrs/cattrs/issues/226>`_)


1.10.0 (2022-01-04)
-------------------
Expand Down
1 change: 1 addition & 0 deletions src/cattr/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ def is_sequence(type: Any) -> bool:
TypingSequence,
TypingMutableSequence,
AbcMutableSequence,
Tuple,
tuple,
)
or (
Expand Down
2 changes: 1 addition & 1 deletion src/cattr/converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,7 @@ def gen_unstructure_iterable(self, cl: Any, unstructure_to=None):

def gen_unstructure_hetero_tuple(self, cl: Any, unstructure_to=None):
unstructure_to = self._unstruct_collection_overrides.get(
get_origin(cl) or cl, unstructure_to or tuple
get_origin(cl) or cl, unstructure_to or list
)
h = make_hetero_tuple_unstructure_fn(cl, self, unstructure_to=unstructure_to)
self._unstructure_func.register_cls_list([(cl, h)], direct=True)
Expand Down