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

Make use of TypedDict #99

Closed
Cito opened this issue Jul 1, 2020 · 3 comments
Closed

Make use of TypedDict #99

Cito opened this issue Jul 1, 2020 · 3 comments
Assignees
Labels
enhancement Enhancement request modernization Update dependencies etc.
Milestone

Comments

@Cito
Copy link
Member

Cito commented Jul 1, 2020

We could make use of TypedDict in several places, for instance as return value of to_kwargs and introspection_from_schema.

Unfortunately, this needs Python 3.8, but we are currently supporting Python 3.6. However, it should be possible to add typing_extensions as additional dependency for Python 3.6 and 3.7 to support TypedDict for these Python versions as well.

@Cito Cito added this to the v3.2 milestone Jul 5, 2020
@Cito Cito added enhancement Enhancement request modernization Update dependencies etc. labels Jul 5, 2020
@KingDarBoja
Copy link

Started to use TypedDict on graphql-server-core, those are awesome to work with and the typing_extensions does the job to bring backward compatibility to Python 3.6 and 3.7. Only thing that you must be aware is that you must provide all values to any TypeDict declaration as those doesn't support default values on class definition as far as I know.

@Cito
Copy link
Member Author

Cito commented Dec 28, 2021

This has now been implemented for introspection_from_schema in 24506f3.

Still needs to be implemented for to_kwargs.

@Cito Cito self-assigned this Dec 28, 2021
@Cito
Copy link
Member Author

Cito commented Jan 14, 2022

This is now also implemented for to_kwargs, so we can close this issue.

@Cito Cito closed this as completed Jan 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement request modernization Update dependencies etc.
Projects
None yet
Development

No branches or pull requests

2 participants