Open diabolo-dan opened 1 year ago
Interesting. It was me who implemented that change in attrs in response to a bug report, so 🙈
Looks like attrs.resolve_types
breaks on generic attrs classes, because typing.get_type_hints
breaks on generic attrs classes.
I can confirm there's an issue. It took me a while to figure out why it works on old attrs though. I need to talk to @hynek to figure out on which end do we want to fix this though.
In the meantime I think you can resolve the issue by calling attrs.resolve_types(A)
by yourself before using the class.
is there any news on this issue?
Description
When working with generic attrs types with cattrs, I updated my version of attrs and it caused failures. Having looked at the changelog in attrs:
https://www.attrs.org/en/stable/changelog.html#id1
This seems likely it was caused by:
Changing the behaviour of: (converters.py 976-977)
in which case it probably can't be described as an attrs bug. (But I don't have high confidence in that).
(I confirmed that
failed on both versions of
attrs
, so the difference is somewhere in theif
statement)What I Did