-
-
Notifications
You must be signed in to change notification settings - Fork 374
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
Python 3.10 compatibility #716
Comments
Do we need to call |
Do I understand it correctly that we are waiting for #593 here? |
Yes. :( |
FTR, when issue 593 is fixed now, I can use assert C.__init__.__annotations__ == {
"x": int,
"y": str,
"return": None,
} still complains about |
The test needs to be changed to get_type_hints I'm afraid. There's a bunch more stuff breaking that I'm working on rn. |
Python 3.10 has string types everywhere and that has unmasked a bunch of bugs/edge cases in our code. Especially the hooks code need a resolving helper for string types. I'm leaving that for a separate PR. Fixes #716
Python 3.10 has string types everywhere and that has unmasked a bunch of bugs/edge cases in our code. Especially the hooks code need a resolving helper for string types. I'm leaving that for a separate PR. Fixes #716
Python 3.10 has string types everywhere and that has unmasked a bunch of bugs/edge cases in our code. Especially the hooks code need a resolving helper for string types. I'm leaving that for a separate PR. Fixes #716
Python 3.10 has string types everywhere and that has unmasked a bunch of bugs/edge cases in our code. Especially the hooks code need a resolving helper for string types. I'm leaving that for a separate PR. Fixes #716
* Add Python 3.10 support Python 3.10 has string types everywhere and that has unmasked a bunch of bugs/edge cases in our code. Especially the hooks code need a resolving helper for string types. I'm leaving that for a separate PR. Fixes #716 * More robust quote handling * Use resolve_types decorator where possible * Use a helper for __init__ annotations * Add test for various ClassVars
Great movement. Can we expect a new release soon? |
We/I need to write some narrative docs about new features and this issue uncovered that our hooks system is very hard to use with Python 3.10/string types, so we'll have to write some kind of |
Hello.
We have already started testing RPM packages in Fedora with Python 3.10a2 and attrs is currently not compatible.
The problem is caused by the implementation of PEP 563 — type annotations are now stored as strings which cause asserts like this one to fail:
The value stored in
attr.fields(C).x.type
is a string "int" instead of a class int.It seems it was discussed before in #424
The text was updated successfully, but these errors were encountered: