Skip to content
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

Tentative support for TypedDict #474

Merged
merged 3 commits into from
Jan 19, 2021
Merged

Tentative support for TypedDict #474

merged 3 commits into from
Jan 19, 2021

Conversation

omry
Copy link
Owner

@omry omry commented Jan 16, 2021

Adds provisional support for typed dict.
Closes #473

@omry omry added this to the OmegaConf 2.1 milestone Jan 16, 2021
@omry omry requested review from odelalleau and pereman2 January 16, 2021 20:16
@pereman2
Copy link
Contributor

I didn't look at it thoroughly but, can TypedDict be merged successfully ?

@omry
Copy link
Owner Author

omry commented Jan 16, 2021

Yes, added a test.
it's treated like a regular dict, there is no additional runtime type safety for it.

@omry omry mentioned this pull request Jan 16, 2021
@omry omry merged commit 48b7a4e into master Jan 19, 2021
@omry omry deleted the typed_dict branch January 19, 2021 22:21
Copy link
Collaborator

@odelalleau odelalleau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, a bit late on that one. I understand that this is only partial support and as a result there is currently no type check on the values, but would have it been easy to at least enforce that the key_type of the resulting DictConfig must be a string?

@omry
Copy link
Owner Author

omry commented Mar 5, 2021

Seems like a reasonably easy thing to add.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support TypedDict
3 participants