cattrs icon indicating copy to clipboard operation
cattrs copied to clipboard

Composable custom class converters for attrs, dataclasses and friends.

Results 110 cattrs issues
Sort by recently updated
recently updated
newest added

* cattrs version: 1.10.0 * Python version: 3.10.2 * Operating System: macOS ### Description I have a nested data structure using attrs and `kw_only`. Converting to a tuple works beautifully,...

* cattrs version: 1.10.0 * Python version: 3.8.10 * Operating System: Ubuntu:20.04 ### Description Consider the following: ``` @define class A: first_field: int second_field: int @define class B: first_field: int...

* cattrs version: 1.10.0 * Python version: 3.10.0 * Operating System: Win ### Description In some cases, `create_uniq_field_dis_func` fails to disambiguate certain unions. The order of arguments matter, which can...

* cattrs version: 1.10.0 * Python version: 3.10 * Operating System: Mac ### Description Hello, Is it possible to add a `takes_metadata` like option to cattrs.Factory similar to the `takes_self`...

* cattrs version: 1.10.0 * Python version: 3.10.0 * Operating System: Win10 ### Description I was experimenting with ways to modify the unstructured data, and noticed that GenConverter accepts the...

* cattrs version: 1.10.0 * Python version: 3.10.2 * Operating System: Ubuntu 20.04.3 ### Description This is related to #201, but probably worth making a separate issue for, since it...

enhancement

I was looking at the code and noticed that in [`converters.py:38`](https://github.com/Tinche/cattrs/blob/master/cattr/converters.py#L38), you use a `Sequence` where an `Iterable` would work for more object types. Looking at [`_dump_seq`](https://github.com/Tinche/cattrs/blob/master/cattr/converters.py#L147), all it does...

enhancement

* cattrs version: 1.9.0 * Python version: 3.7 * Operating System: MacOS (M1), Ubuntu ### Description It appears `cattr.gen.make_dict_structure_fn` returns an object type which does not provide type expected by...

* cattrs version: 1.8.0 (attrs 21.2.0) * Python version: 3.9.7 * Operating System: Windows 10 ### Description When using recursive types (see example below), `structure` with `GenConverter` raises a `StructureHandlerNotFoundError`...

Is it possible to extend a `Converter` instance, i.e. make a copy and define new or override old hooks? This would be an extremely useful feature, but I couldn't find...

enhancement