Tin Tvrtković

Results 444 comments of Tin Tvrtković

@asford The fix needs to be here: https://github.com/Tinche/cattrs/blob/161dbd7b0ebd36123480ea770efab1929b2e57c6/src/cattr/gen.py#L151 (I guess just skipping attributes which are `init=False`).

I might start on this soonish. But what should the spec be? If the key is present in the payload, use a setter instead of the initializer? Or should we...

Yeah I agree, let's skip for now and if there's demand we can revisit later with an option.

Just out of curiosity, what do you folks use `init=False` fields for? Computed attributes set in post init?

Hm, can you give an example? Your use case sounds like a `ClassVar` would be appropriate?

@jpsnyder Interesting. Could you remove the field and create an unstructuring hook that adds it, for serialization?

Hello! The issue is `prefer_attrib_converters` only works with leaf nodes (so, no generics, and your `A.x` field is typed as a list). The reason for this is what otherwise, a...

Yeah, this approach seems very messy. I was thinking of allowing the user to override the structuring hook on a per-attribute basis. So for your case, you'd have to do...

Interesting, what happens if you just unstructure an instance of `Foo`?

Something's definitely fishy here. Will look into it.