Ignore PEP 649 + 695 implementation details in stubtest - #18469
Conversation
| "__subclasshook__", | ||
| "__subclasscheck__", | ||
| # PEP 695 implementation details | ||
| "__annotate__", |
There was a problem hiding this comment.
__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.
__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
|
Resolved with |
|
Oops, sorry for forgetting about this PR! |
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.