Closed epenet closed 5 days ago
You can only use PEP 604 starting from Python 3.10. This library needs to evaluate annotations in order to work but this syntax is invalid on Python 3.9.
You can use PEP 604 in combination with from __future__ import annotations
This is what is done with other modules in that project.
Can mashumaro not use this?
You can use PEP 604 in combination with
from __future__ import annotations
This is what is done with other modules in that project.Can mashumaro not use this?
You don't understand the purpose of from __future__ import annotations
. You can use this combination only for the tools that don't evaluate expressions — like mypy.
Description
I am trying to use PEP 604 annotations in my project, replacing annotations such as
Optional[int]
withint | None
.What I Did
I added
from __future__ import annotations
at the top of the module, so that Python 3.9 could understand it, butmashumaro
still errors. See https://github.com/hacf-fr/sfrbox-api/actions/runs/10827545154/job/30040944493?pr=344