Open bvle opened 4 weeks ago
@bvle alpha version is not something we'll look at right now. Does this reproduce on 3.9-3.12?
Newer versions of Python tend to give better errors messages, so that's why I used Python 3.14. I was also able to reproduce the issue in:
Description
Whenever I use
.from_dict()
(or.from_json()
) it errors out with aNameError
, saying that the types haven't been defined, even though it is defined within theTYPE_CHECKING
block.Looks like the root cause is with
typing.get_type_hints()
, which has already been reported, but not touched since 2022: https://bugs.python.org/issue43463Code snippet that reproduces the issue
Describe the results you expected
Everything imported in the
TYPE_CHECKING
block should be imported when needed, as with.from_dict()
.From the code snippet above, the expected output is:
Python version you are using
Python 3.14.0a0
Environment description
dataclasses-json==0.6.6 marshmallow==3.21.3 mypy-extensions==1.0.0 packaging==24.0 typing-inspect==0.9.0 typing_extensions==4.12.1