New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Breaks marshmallow_dataclass.NewType
#91
Comments
marshmallow_dataclass.NewType
marshmallow_dataclass.NewType
@gabor-akeero it's questionable whether this needs to be fixed here (although an optional |
FYI, my fix for |
A release has just been made of marshmallow-dataclass 8.5.9 that includes @vit-zikmund’s fixes for |
This issue has been fixed at |
In is_new_type there is an explicit check for the module name being either
typing
ortyping_extensions
, so types created via marshmallow_dataclass.NewType are no longer recognised, and therefore cannot be used in marshmallow dataclasses.This check on
__module__
makes it impossible to define and use any customNewType
implementations, even if they are intended to be accepted asNewType
.As the pre-3.10 implementations of
typing.NewType
define only two extra attributes__name__
and__supertype__
, I'd suggest a check on these two (besides__qualname__
), and on their types:This would check everything that we can be sure of, and wouldn't block the custom
NewType
-implementations.The text was updated successfully, but these errors were encountered: