-
Notifications
You must be signed in to change notification settings - Fork 104
Advanced type hinting support #102
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like that wasn't too bad
This is used internally to convert a raw JSON loaded value to a specific | ||
type hint. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this more like?
This is used internally to convert a raw JSON loaded value to a specific | |
type hint. | |
This is used internally to convert a raw JSON loaded value to an instance | |
of a specific type. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is used internally to convert a raw JSON loaded value to a specific | |
type hint. | |
This is used internally to convert a raw JSON loaded value using a specific | |
type hint. |
That may be clearer. Will change if there is another commit here.
@Sushisource - It wasn't too bad, but I fear people may have custom needs and it may be hard to document in detailed form what we specifically support. Also, while the code is small, it may not be obvious to users that, for example, a union tries all union types and chooses the first one (so if the first dataclass matched I wouldn't try the second). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests look good didn't look into the implementation too much.
What was changed
dacite
Why?
Need to support all sorts of type hints like
Optional
,Union
, etcChecklist