Is your feature request related to a problem? Please describe.
Code that is stuck with Python 3.8 and cannot use future annotations and has to use List, Optional, Union, etc.
Describe the solution you'd like
It would be nice if it was possible to "modernize" Griffe expressions on-the-fly, transforming Optional[...] into ... | None, Union[A, B] into A | B, etc.
Describe alternatives you've considered
/
Additional context
Originally asked by @tiangolo in fastapi/fastapi#10392 (comment)
Is your feature request related to a problem? Please describe.
Code that is stuck with Python 3.8 and cannot use future annotations and has to use List, Optional, Union, etc.
Describe the solution you'd like
It would be nice if it was possible to "modernize" Griffe expressions on-the-fly, transforming
Optional[...]into... | None,Union[A, B]intoA | B, etc.Describe alternatives you've considered
/
Additional context
Originally asked by @tiangolo in fastapi/fastapi#10392 (comment)