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
PEP 604, which was implemented in Python 3.10, allows for unions to be specified through using the pipe (union) operator. As the Optional[<type>] type already is essentially a shortcut for Union[<type>,None], the new implementation also means that Union[<type>, None] is able to be written as <type> | None. This confuses desert right now and it fails to be able to make a schema.
The current work-around is to still use the Optional[<type>] syntax, which involves importing Optional from typing. It would be nice if desert was more flexible for this.
The text was updated successfully, but these errors were encountered:
PEP 604, which was implemented in Python 3.10, allows for unions to be specified through using the pipe (union) operator. As the
Optional[<type>]
type already is essentially a shortcut forUnion[<type>,None]
, the new implementation also means thatUnion[<type>, None]
is able to be written as<type> | None
. This confuses desert right now and it fails to be able to make a schema.The current work-around is to still use the
Optional[<type>]
syntax, which involves importing Optional from typing. It would be nice if desert was more flexible for this.The text was updated successfully, but these errors were encountered: