-
Notifications
You must be signed in to change notification settings - Fork 122
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
[Bug] [Python 3.10] Crash when using postponed evaluation of annotations #303
Comments
What is this supposed to do? |
Okay, I saw the answer in the pep. Thanks for the heads up. |
I came here to report the same bug. This is truly a bug that I encountered (using other third party tools hydra-core) and took me a whole day to figure out what is being wrong, largely because the TypeError output message is very hard to decipher. Please also consider making early assertions so that the type error reads more sensible (like type annotation for field xx is missing..) |
Are you using Python 3.10? |
If you are not using Python 3.10 (as I suspect is the case), please file a different issue with a minimal repro. |
If The solution should be simple: instead of using |
At this point this is low priority, but feel free to send a pull request. |
I just hit this issue, please merge this PR ASAP! In my experience almost all code that uses types heavily uses |
@gibiansky, mind jumping into the chat to tell me more about your use case? |
A relatively clean workaround is to put your config types / dataclasses in a separate file in which you don't use |
I am hitting the same issue with omegaconf 2.0.6 on Python 3.7.9. Will this go into a patch release on 2.0.x or will it be released as part of 2.1? |
It is planned to be released with 2.1. Note that there are some known breaking changes, you can look at the news directory for *.api_change. |
🐛 Bug
Structured configs seem not to work with the upcoming postponed evaluation of annotations (https://www.python.org/dev/peps/pep-0563/) which will be the default in Python 3.10.
Obviously not really a problem yet but flagging it now as a FYI.
To reproduce
** Minimal Code/Config snippet to reproduce **
** Stack trace/error message **
The text was updated successfully, but these errors were encountered: