-
Notifications
You must be signed in to change notification settings - Fork 5
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
Make a howard decorator #1
Comments
I think you better be off with inheriting a class because as of now you can't tell mypy that a decorator adds method to the class it's applied to. |
I'd love a Howard decorator, but the mypy thing does look awkward. References: |
Ogaday
added a commit
to Ogaday/howard
that referenced
this issue
Feb 28, 2020
I want to be able to load and dump numerous unsupported types using Howard. This functionality allows loading/dumping functions to be specified at conversion time, on a per class basis. In the future I can imagine a howard class to which you can pass your custom encoders and other arguments (such as public/strict) so that the same arguments don't need to be passed at each call of from_dict/to_dict. This could also tie into nhumrich#1 - either as a decorator or mixin.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Could have a class decorator that adds the
fromdict
andtodict
methods to the class as classmethods.example:
The text was updated successfully, but these errors were encountered: