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
Use of Optional and Union can now be migrated to using the | operator in the following circumstances:
parameter annotations of functions decorated with @valimp.parse (get_type_hints did not support the | operator prior to py 3.10). For example, Optional[Union[str, float, int]] can now be annotated as str | float | int | None.
creating type aliases, for example Symbols = Union[list[str], str] can now be defined as Symbols = list[str] | str
Indeed, search across the library for any references to Optional and Union, including with the docs, and remove / revise.
Should also be able to lose the from __future__ import annoations lines from the top of modules.
type annotations
Optional
andUnion
can now be migrated to using the|
operator in the following circumstances:@valimp.parse
(get_type_hints did not support the | operator prior to py 3.10). For example,Optional[Union[str, float, int]]
can now be annotated asstr | float | int | None
.Symbols = Union[list[str], str]
can now be defined asSymbols = list[str] | str
Optional
andUnion
, including with the docs, and remove / revise.from __future__ import annoations
lines from the top of modules.The text was updated successfully, but these errors were encountered: