Skip to content

Commit

Permalink
Final tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
Tinche committed Aug 27, 2023
1 parent 66571e1 commit d2f3c96
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
([#410](https://github.com/python-attrs/cattrs/issues/410) [#411](https://github.com/python-attrs/cattrs/pull/411))
- Introduce the `use_class_methods` strategy. Learn more [here](https://catt.rs/en/latest/strategies.html#using-class-specific-structure-and-unstructure-methods).
([#405](https://github.com/python-attrs/cattrs/pull/405))
- Implement the _union passthrough_ strategy, enabling much richer union handling for preconfigured converters. [Learn more here](https://catt.rs/en/stable/strategies.html#union-passthrough).
- Implement the `union passthrough` strategy, enabling much richer union handling for preconfigured converters. [Learn more here](https://catt.rs/en/stable/strategies.html#union-passthrough).
- The `omit` parameter of {py:func}`cattrs.override` is now of type `bool | None` (from `bool`).
`None` is the new default and means to apply default _cattrs_ handling to the attribute, which is to omit the attribute if it's marked as `init=False`, and keep it otherwise.
- Fix {py:func}`format_exception() <cattrs.v.format_exception>` parameter working for recursive calls to {py:func}`transform_error <cattrs.transform_error>`.
Expand Down
4 changes: 3 additions & 1 deletion tests/test_preconf.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,9 @@ def native_unions(
strats[bytes] = binary()
if include_datetimes:
types.append(datetime)
strats[datetime] = datetimes(max_value=datetime(2038, 1, 1))
strats[datetime] = datetimes(
min_value=datetime(1970, 1, 1), max_value=datetime(2038, 1, 1)
)
if include_objectids:
types.append(ObjectId)
strats[ObjectId] = builds(ObjectId)
Expand Down

0 comments on commit d2f3c96

Please sign in to comment.