python-attrs / cattrs

Composable custom class converters for attrs, dataclasses and friends.
https://catt.rs
MIT License
791 stars 110 forks source link

Add a regression test for a nested tagged union scenario #444

Closed bluetech closed 9 months ago

bluetech commented 9 months ago

I've converted some project which uses cattrs from attrs to dataclasses, but that failed because the union dismbiguator doesn't support dataclasses yet (https://github.com/python-attrs/cattrs/issues/426#issuecomment-1731787790). So I used the opportunity to convert the code to the new tagged union strategy which is much nicer than the disambiguation stuff anyway. One case looks like the test added in this PR, which failed too (cattrs v23.1.2). Looking into it I saw that the problem has been fixed in main by commit b25a25800f245d4504f8d9aaaa90faeca3e4adbb. So I'm awaiting a new release, but in the meantime thought this regression test might be helpful.

Tinche commented 9 months ago

Cool, thanks. The next release is imminent!