-
Notifications
You must be signed in to change notification settings - Fork 13
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
Support __futre__.annotations #51
base: main
Are you sure you want to change the base?
Conversation
When importing __future__.annotations, class annotations are evaluated lazily, and dataclasses.Field.type becomes str instead of actual type. To access its accutual type, we patch the member. Ref: mivade#47
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.
We'll want to somehow add tests for this.
@mivade
I agree with you. If you have good ideas, please let me know. |
As far as I checked[*1], I think test covers with and without annotations. What I don't understand is CI test. On my local machine with docker container ( I have no idea. [*1] [*2]
|
When importing
__future__.annotations
, class annotations are evaluated lazily, anddataclasses.Field.type
becomesstr
instead of actual type.To access its actual type, I patch the member.
Ref: #47
I tested with
tox -e .
on Python:3.10 docker container.