PyQt6 6.12.1 stubs: typing.Self breaks type checking across all modules
Dragan A.
forumwt at gmail.com
Sun Nov 15 23:08:31 GMT 2026
Hi Phil,
Veronica reported two pyright errors with the 6.12.1 stubs
(https://www.riverbankcomputing.com/pipermail/pyqt/2026-November/046574.html
).
They are not two separate issues. The 6.12.1 stubs replace a class's own
name with typing.Self everywhere, and in most of those places Self is
wrong.
6.12.0 works fine: pyright reports 0 errors in our project. After updating
to 6.12.1, with no other change, it reports 716 errors in 136 files. For
example, 6.12.0 has
QCoreApplication.instance() -> 'QCoreApplication|None'
where 6.12.1 has
QCoreApplication.instance() -> typing.Self
QtCore.pyi in 6.12.0 doesn't use typing.Self at all; in 6.12.1 it
appears 567 times. The code runs fine on 6.12.1; only the stubs are wrong.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20261116/895580da/attachment.htm>
More information about the PyQt
mailing list