<div dir="ltr">Hi,<br><br>The type stubs shipped with PyQt6 6.10.2 reference names they don't import.<br>In strict mode Pyright then reports every signal connect(), QTimer.singleShot()<br>and pyqtSlot() use as partially unknown. In our project that is about 1,000<br>errors.<br><br>Environment:<br>  PyQt6 6.10.2, PyQt6-Qt6 6.10.2, PyQt6-sip 13.13.0<br>  Python 3.14.8, Windows 11<br>  Pyright 1.1.414<br><br>Problems in PyQt6/QtCore.pyi:<br><br>1. Any is used but never imported (line 78):<br>     PYQT_SLOT = typing.Union[collections.abc.Callable[..., Any], pyqtBoundSignal]<br><br>2. collections.abc is used, but only "collections" is imported (line 23):<br>     import collections, re, typing, enum<br>   so collections.abc.Callable does not resolve (lines 68, 69, 78).<br>   The same applies to the other .pyi files that use collections.abc.<br><br>3. *types in pyqtSlot() has no annotation (line 69):<br>     def pyqtSlot(*types, name: typing.Optional[str] = ..., result: ...) -> ...<br><br>4. __eq__ has no return type (QDate, line 3491, and other classes):<br>     def __eq__(self, other: object): ...<br><br>To reproduce, with only PyQt6 6.10.2 and pyright installed:<br>  pip install PyQt6==6.10.2 pyright<br>  pyright pyqt6_stub_repro.py      (attached)<br><br>Output:<br>  2:62  error: Type of "pyqtSlot" is partially unknown<br>          Type of "pyqtSlot" is "(*types: Unknown, name: str | None = ...,<br>          result: str | None = ...) -> Unknown"<br>  10:6  error: Untyped function decorator obscures type of function<br>  17:1  error: Type of "connect" is partially unknown<br>          Type of "connect" is "(slot: Unknown | pyqtBoundSignal) -> Connection"<br>  18:1  error: Type of "singleShot" is partially unknown<br>  20:1  error: Type of "same_day" is unknown<br>  21:7  error: Argument type is unknown<br>  6 errors<br><br>Adding "from typing import Any" and "import collections.abc" to the .pyi<br>files removes almost all of them. Annotating *types (e.g. *types: Any) and<br>adding "-> bool" to __eq__/__ne__ fixes the rest.<br><br>Thanks,</div>