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
Describe the bug
3.10 introduced PEP-604 which allows writing unions as X | Y over Union[X, Y]. However, internally the type of such annotation is not typing.Union, it's types.UnionType. attrs-strict doesn't recognise it, leading to validation errors.
Describe the bug
3.10 introduced PEP-604 which allows writing unions as
X | Y
overUnion[X, Y]
. However, internally the type of such annotation is nottyping.Union
, it'stypes.UnionType
.attrs-strict
doesn't recognise it, leading to validation errors.To Reproduce
Expected behavior
The above example should work.
Actual behavior
attrs_strict._error.AttributeTypeError: a must be int | None (got 10 that is a <class 'int'>)
Environment (please complete the following information):
Additional context
Here's a similar issue in pydantic related to union types as a reference: pydantic/pydantic#3300
The text was updated successfully, but these errors were encountered: