Closed EloiZalczer closed 2 years ago
I believe this is a duplicate of #206. If so, it is fixed in the master branch but the fix has not yet made it into a release. See PRs #207 and #211
A workaround is to pin typing-inspect<0.8.0
.
I will see if I can generate a new release of marshmallow-dataclass.
Fixed in marshmallow_dataclass==8.5.9
Thanks for the release ! Sorry about the duplicate.
When running the example code from the NewType docstring, I get the following exception:
The issue seems to happen in typing_inspect.py at line 287, in function is_new_type. For versions prior to Python 3.10.0, the check is the following:
However, in the case of new types created via marshmallowdataclass, the \_module__ is set to 'marshmallow_dataclass'. Therefore, the new type is not recognized as such and marshmallow_dataclass treats it as a nested field.
I'm using Python 3.8 and marshmallow-dataclass==8.5.8