Tin Tvrtković
Tin Tvrtković
Have you seen https://catt.rs/en/stable/strategies.html#using-class-specific-structure-and-unstructure-methods? Feels like it matches this use case. Here's how this would look like using that strategy: ```python from __future__ import annotations import math from attrs import...
I got a little inspired and wanted to explore this idea I had. My idea was that a signature for an alternate constructor method could be expressed as a TypedDict,...
> The crux of the described use case lies in the fact that the selection of the constructor cannot be static but must be configurable at runtime. Interesting. I guess...
There's also a way where we invent something new, like a recipes section in the user manual. Think that might be a good way to go for things we're unsure...
Closing since the docs PR was merged.
There's a way but it's somewhat complex so let me ask you a few questions first. The `type` field is a constant, right? You'd expect all instances of `SpecialDevice` to...
Ok, so the problem is that the `tagged_union` strategy deletes the `type` key out. If you want to keep the key in the payload, we can apply some good old...
Howdy! You're right, the structure hook for lists (and sequences, mutablesequences, homogenous tuples) is very simple; you can see it [here](https://github.com/python-attrs/cattrs/blob/6fe5431b2af419780820ab24ca30a7fb8efdd08a/src/cattrs/converters.py#L752). In the case of no detailed validation, it boils...
The `use_class_methods` strategy was originally meant to be used with on _attrs_ classes and dataclasses, but I see no reason why enums should be excluded. I'll mark this issue as...
> Maybe it would just be enough to be explicit in [this section of the docs](https://catt.rs/en/stable/structuring.html#enums) that custom structuring of Enums isn't supported? Custom structuring of enums should be *very*...