-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Fix type annotations examples #496
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
Fix type annotations examples #496
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.
Actually you can just do from __future__ import annotations
and these type errors will go away on 3.9
Yes, I thought that was the solution, but it doesn't work when using For example, I got the following error:
Let me know if I'm wrong and I have to change the pull request. |
cool - can you fix lint please? |
oh wait lint is complaining about the exact thing i talked about hmm |
I think you can do what it says and add https://pypi.org/project/eval-type-backport/, based on pydantic/pydantic#7873 |
I added the library to the dependencies as suggested, it should work now, tests passed |
I fixed the type annotations errors for pydantic objects in some examples as noted in #490 .
When running
make lint
the following error occurs "UP007 UseX | Y
for type annotations". If you know how to ignore it I will be happy to edit the pull request, thanks.