-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Ignore PEP 649 + 695 implementation details in stubtest #18469
base: master
Are you sure you want to change the base?
Conversation
mypy/stubtest.py
Outdated
@@ -1486,6 +1486,9 @@ def verify_typealias( | |||
"__instancecheck__", | |||
"__subclasshook__", | |||
"__subclasscheck__", | |||
# PEP 695 implementation details | |||
"__annotate__", |
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.
__annotate__
is from PEP 649, not 695. __classdictcell__
does come from PEP 695 (so it's already in 3.12+), but is used only during class body execution and I don't think stubtest should see it. Did you encounter problems with it?
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.
__annotate__
is from PEP 649, not 695.__classdictcell__
does come from PEP 695 (so it's already in 3.12+), but is used only during class body execution and I don't think stubtest should see it.
Seems I mixed them up again. Sorry about that.
Did you encounter problems with it?
I did ran the test suite with Python 3.14.0a4
yesterday. These were two of the test failures. IIRC they had been there since some time, maybe 3.14.0a1?
___________________________________________________ StubtestUnit.test_named_tuple ___________________________________________________
...
E AssertionError: error: test_module.X1.__annotate__ is not present in stub
E Stub: in file test_module.pyi
E MISSING
E Runtime: in file /.../cpython/Lib/typing.py:2982
E def (format)
E
E error: test_module.X1.__classdictcell__ is not present in stub
E Stub: in file test_module.pyi
E MISSING
E Runtime:
E <cell at 0x108763ee0: dict object at 0x1088a70c0>
E
E error: test_module.X2.__annotate__ is not present in stub
E Stub: in file test_module.pyi
E MISSING
E Runtime: in file /.../cpython/Lib/typing.py:2982
E def (format)
E
E error: test_module.X2.__classdictcell__ is not present in stub
E Stub: in file test_module.pyi
E MISSING
E Runtime:
E <cell at 0x108763490: dict object at 0x1088a6140>
E
E ...
E assert {'test_module...e.X2.__new__'} == {'test_module.X2.__new__'}
E
E Extra items in the left set:
E 'test_module.X1.__classdictcell__'
E 'test_module.X2.__classdictcell__'
E 'test_module.X1.__annotate__'
E 'test_module.X2.__annotate__'
E Use -v to get more diff
mypy/test/teststubtest.py:233: AssertionError
_____________________________________________ StubtestUnit.test_runtime_typing_objects ______________________________________________
...
E AssertionError: error: test_module.X.__annotate__ is not present in stub
E Stub: in file test_module.pyi
E MISSING
E Runtime: in file test_module.py:3
E def (format, /)
E
E Found 1 error (checked 1 module)
E
E assert {'test_module.X.__annotate__'} == set()
E
E Extra items in the left set:
E 'test_module.X.__annotate__'
E Use -v to get more diff
mypy/test/teststubtest.py:233: AssertionError
====================================================== short test summary info ======================================================
FAILED mypy/test/teststubtest.py::StubtestUnit::test_named_tuple - AssertionError: error: test_module.X1.__annotate__ is not present in stub
FAILED mypy/test/teststubtest.py::StubtestUnit::test_runtime_typing_objects - AssertionError: error: test_module.X.__annotate__ is not present in stub
74647a8
to
c8c9901
Compare
PEP 649 added
__annotate__
and PEP 695__classdictcell__
. At the moment it looks like 649 will be enabled with 3.14 at which point stubtest would complain about these. It probably makes sense to add them to the ignore list now.