Skip to content

Commit

Permalink
More docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Tinche committed Oct 27, 2024
1 parent f1467df commit 7e9de9a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions docs/defaulthooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,10 @@ defaultdict(<function <lambda> at ...>, {'key': 1})

`defaultdicts` are unstructured into plain dictionaries.

```{note}
`defaultdicts` are not supported by the BaseConverter.
```

```{versionadded} 24.2.0

```
Expand Down
4 changes: 3 additions & 1 deletion src/cattrs/converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -1172,7 +1172,9 @@ def __init__(
self.register_structure_hook_factory(is_annotated, self.gen_structure_annotated)
self.register_structure_hook_factory(is_mapping, self.gen_structure_mapping)
self.register_structure_hook_factory(is_counter, self.gen_structure_counter)
self.register_structure_hook_factory(is_defaultdict, defaultdict_structure_factory)
self.register_structure_hook_factory(
is_defaultdict, defaultdict_structure_factory
)
self.register_structure_hook_factory(is_typeddict, self.gen_structure_typeddict)
self.register_structure_hook_factory(
lambda t: get_newtype_base(t) is not None, self.get_structure_newtype
Expand Down

0 comments on commit 7e9de9a

Please sign in to comment.