You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that dispatching on a generic type parameter returns the identity function, whereas previously, this would dispatch to the value type. It seems like there's a missing hook for handling typevars with optional.
Description
I upgraded cattr from 22.2.0 -> 23.2.0 and I noticed a difference in behaviour for unstructuring optional generic types.
I've attached a minimally reproducing script that shows the differences in output between the two versions
What I Did
See this code:
On cattrs 22.2.0, this prints:
On cattrs 23.2.0, this prints:
I noticed that dispatching on a generic type parameter returns the
identity
function, whereas previously, this would dispatch to the value type. It seems like there's a missing hook for handling typevars with optional.The text was updated successfully, but these errors were encountered: