cattrs
cattrs copied to clipboard
Composable custom class converters for attrs, dataclasses and friends.
As I was working with cattrs recently, I notice there are some places where annotations are still missing. Hopefully this PR address most of the popular API to be annotated.
* cattrs version: 22.1.0 * Python version: 3.10.5 * Operating System: Linux ### Description Hi, I wanted to have fancy code and decided to subclass built-in list. I run into...
When structuring a heterogeneous tuple, if the input has too few or many elements, this PR now raises an error. The error is a `ValueError` in non-detailed validation. Two existing...
I am currently in the process of upgrading dependencies of our internal libraries and tooling. I noticed the new versioning scheme and have a few questions. The changelog simply states...
### Description Right now, it seems like union types are only supported if (a) the options are all attrs classes or None and (b) the attrs classes have unique attributes....
* cattrs version: current master * Python version: 3.10 * Operating System: Linux ### The error ``` File ".venv/lib/python3.10/site-packages/cattrs/dispatch.py", line 122, in dispatch return handler(typ) File ".venv/lib/python3.10/site-packages/cattrs/converters.py", line 829, in...
* cattrs version: 1.10.0 * Python version: 3.7 * Operating System: Linux 5.16.1-1 OpenSUSE Thumbleweed I want to register structure/unstructure hooks for classes which inherit `typing.Generic` and using a `T...
* cattrs version: cattrs version: 22.1.0 * Python version: 3.10 * Operating System: MacOS Monterey 12.2.1 ### Description I tried to structure some data into the union type with keys...
* cattrs version: 22.1.0 * Python version: 3.9 ### Description Thanks for this amazing library !! I am trying to write disambiguation function to handle union type based on the...
* cattrs version: 22.1.0 * Python version: 3.10.3 * Operating System: Windows 11 ### Description When I structure a raw dictionary into a data class, if there's one or more...