Fixing imports in type-stubs for Pyright
Phil Thompson
phil at riverbankcomputing.com
Thu May 28 16:48:48 BST 2026
On 28/05/2026 10:20, Mikaël Capelle wrote:
> In many PyQt6 stubs file, abstract collections from `collections.abc`
> are
> used, but the import is `collections` which breaks pyright (see
> https://github.com/microsoft/pyright/issues/5241), which is one of the
> most
> commonly used type checker.
>
> An easy fix would to import `collections.abc` instead of simply
> `collections` (or both if both are needed) in the stubs file.
>
> Holt59
Can you point me to a specific example?
Phil
More information about the PyQt
mailing list