Skip to content

Commit e00008f

Browse files
committed
register_un/structure_hook: support type aliases
1 parent 0b6586a commit e00008f

File tree

5 files changed

+86
-148
lines changed

5 files changed

+86
-148
lines changed

HISTORY.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ Our backwards-compatibility policy can be found [here](https://github.com/python
2222
- [`typing.Self`](https://docs.python.org/3/library/typing.html#typing.Self) is now supported in _attrs_ classes, dataclasses, TypedDicts and the dict NamedTuple factories.
2323
See [`typing.Self`](https://catt.rs/en/latest/defaulthooks.html#typing-self) for details.
2424
([#299](https://github.com/python-attrs/cattrs/issues/299) [#627](https://github.com/python-attrs/cattrs/pull/627))
25+
- PEP 695 type aliases can now be used with {meth}`Converter.register_structure_hook` and {meth}`Converter.register_unstructure_hook`.
26+
Previously, they required the use of {meth}`Converter.register_structure_hook_func` (which is still supported).
2527
- Expose {func}`cattrs.cols.mapping_unstructure_factory` through {mod}`cattrs.cols`.
2628
- Some `defaultdicts` are now [supported by default](https://catt.rs/en/latest/defaulthooks.html#defaultdicts), and
2729
{func}`cattrs.cols.is_defaultdict` and {func}`cattrs.cols.defaultdict_structure_factory` are exposed through {mod}`cattrs.cols`.

0 commit comments

Comments
 (0)