cattrs
cattrs copied to clipboard
Composable custom class converters for attrs, dataclasses and friends.
* cattrs version: 24.1.2 * Python version: 3.11 * Operating System: Linux/MacOSX ### Description I am not sure how to handle union with subclass. ### What I Did ``` import...
### Description Is it possible to get the keys that were not used during a call to `structure(input_dict, SomeClass)`? One way would be to use `forbid_extra_keys` to get the names...
Hi @Tinche, my [previous issue](#657) was basically pointless but I'm now getting closer to the heart of my problem. While I think I understand how regular hooks can be composed,...
I can't work out how to obtain a reference to the object instance or field causing a validation error when calling cattrs.structure For example: ``` from attrs import define from...
cattrs version: 24.1.3 Hi cattrs team, The round-trip serialization of a union type in the following case is not guaranteed. It is clearly stated in the manual that built-in types...
In Fedora, we’re already testing Python packages with pre-releases of Python 3.14, which will be included in Fedora 43 in late 2025. This report is based on a [downstream issue](https://bugzilla.redhat.com/show_bug.cgi?id=2343916)...
Hello, I’m not sure if I just can’t figure out how to do it or if it’s not supported. I have a generic message envelope like this: ``` @frozen class...
Contribution to #641. Converters supported: - `BaseConverter`, `Converter`, all preconfigured converters Extra types added: - `complex` - `uuid.UUID` - `zoneinfo.ZoneInfo` More extra types to be added in this pull request:...
`cattrs` comes with a rich set of converters, but the variety of types supported by those converters out of the box is limited. Adding custom structure/unstructure hooks is pretty straightforward...