Import typeddict from typing_extentions#104
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
|
Do you have a link that explains why it's needed? The link you provided lists:
We only support 3.9+, so it sounds like it's already OK, but that obviously isn't your experience so I'd like to understand the problem better. |
There was a problem hiding this comment.
This looks pretty reasonable.
The tests only pass because typing_extensions is indirectly pulled in by our [dev] install.
Before we merge this, we need to add typing-extensions to the requirements in setup.py.
Optional: use environment markers to make it a conditional requirement.
|
To keep things simple is there any downside to always importing from typing-extensions? I think I'm going to start with that. |
Description of the change
When using classes from the types with Pydantic [as mentioned here],(https://docs.pydantic.dev/2.1/usage/types/dicts_mapping/#typeddict) Pydantic throws an error that typeddict needs to come from typing_extentions for python < 3.11, hence this PR.
Motivation
Allows this packages classes to be used within pydantic based classes.
Type of change
Choose one: Bug Fix for #102
Checklist
git pull --rebase upstream main).