-
Notifications
You must be signed in to change notification settings - Fork 54
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
Default handling logic for simpleparsing.parse doesn't respect dataclasses with custom decoder #266
Comments
Hey @dlwh , encoding = dc->dict (via the Therefore asdict is more about encoding, and therefore I dont understand why calling asdict on the dataclass would be wrong if it has a custom decoding function registered. |
I dont completely understand the test in the issue atm. I'll take a better look a bit later today. |
When parsing with a config file, the custom decoding function isnt being used? |
Would you mind helping me out @dlwh ? I'm still having trouble understanding what the issue is here. |
Yes, dataclasses that have custom decode functions (like (FWIW, I ended up forking Pyrallis so I'm going it alone, so happy to just close this.) |
Describe the bug
The default parsing logic seems to want to call asdict on a dataclass field even if it has a registered decoding function:
To Reproduce
Expected behavior
Test should pass.
Actual behavior
Last assertion fails:
Desktop (please complete the following information):
Additional context
The text was updated successfully, but these errors were encountered: