-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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.11 tracking issue #12840
Comments
I started off writing a comment, but it got too long so I created a separate issue instead: there's a ton of new |
Okay, we're down to four failing tests with Python 3.11:
#13125 takes care of testCheckVersion |
@97littleleaf11 any interest in taking a look at the testProtocol failure? :-) |
#13206 should fix testProtocol and testPickling |
Okay, CPython has rolled back changes, see python/cpython#92678 and python/cpython#95589. We should still confirm that with RC or B6 or whatever, we'll just have |
If you want to link the PEP 673 issue, it's here: #11871 |
Okay, with RC1 we have the following tests failing:
|
Ref #12840 It looks like from the point of view of type checking support is quite easy. Mypyc support however requires some actual work, so I don't include it in this PR.
Ref #12840 It looks like from the point of view of type checking support is quite easy. Mypyc support however requires some actual work, so I don't include it in this PR.
Ref #12840 Fixes #11871 Fixes #14089 This is an alternative implementation to two existing PRs: #11666, #13133. This PR treats `typing.Self` as pure syntactic sugar, and transforms it into a type variable early during semantic analyzis. This way we can re-use all the existing machinery and handled edge cases for self-types. The only new thing is self-type for _attributes_ (as proposed in the PEP). This required handling in several places, since attribute access is duplicated in several places (see #7724), plus special forms (like NamedTuples and TypedDicts) and dataclasses plugin require additional care, since they use attribute annotations in special ways. I don't copy all the existing tests for "old style" self-types, but only some common use cases, possible error conditions, and relevant new edge cases, such as e.g. special forms mentioned above, and implicit type variable binding for callable types.
Hypothetically speaking, if I wanted to add support for dataclass_transform, would that be a possibility? |
It is not being worked on as far as I am aware, and you don't need approval, feel free to get started on working on it if you are interested! We use a mypy plugin to analyze dataclasses so you'll probably want to start there https://github.com/python/mypy/blob/master/mypy/plugins/dataclasses.py |
Since Python 3.11, T = NewType("T", Any)
> error: Argument 2 to NewType(...) must be subclassable (got "Any") [valid-newtype] The issue was closed as wontfix but maybe this can now be supported? |
Added #14293 for PEP 681 so that we can track it 😄 |
What about the changes to |
I believe we can consider dataclass_transform supported now |
For completeness' sake, here's the PEP 646 issue: |
I don't think we need to keep this open. Almost everything is now implemented, and for couple remaining things we have dedicated issues. |
General, language:
New typing features:
The text was updated successfully, but these errors were encountered: