-
Notifications
You must be signed in to change notification settings - Fork 11
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
Added support for ForwardRef types #15
Conversation
Added code to evaluate typing.ForwardRef types. These are generally used to reference types that haven't been defined yet. Unfortunately to evaluate these types you need to pass a dictionary containing all the globals to all the validate functions so that the type can be evaluated. This has meant that many lines had to updated just to add the additional argument. Also had to add special handling of the Optional type to enable the tests to pass on Python 3.9.
Thank you for your contribution. |
With your support, it now works with Python 3.9 as well. Thanks! pytest result using Python 3.8
|
I see now that I have mixed up two different changes in the one pull request, upgrading to python 3.9 and support ForwardRef types. I will submit a targeted pull request to cover off just the 3.9 upgrade and then will revisit this pull request. |
The ForwardRef._evaluate function takes 3 arguments on python 3.9 and only 2 on 3.8.
Ok. The branch has been updated to support both 3.8 and 3.9. |
@mlamby v0.1.1 released! Thank you for your contribution! |
Awesome! Thanks for your help. |
This pull request is to address #14.
Added code to evaluate typing.ForwardRef types. These are generally used to
reference types that haven't been defined yet. Unfortunately to evaluate
these types you need to pass a dictionary containing all the globals to all
the validate functions so that the type can be evaluated. This has meant
that many lines had to updated just to add the additional argument.
Also had to add special handling of the Optional type to enable the
tests to pass on Python 3.9.