PyQt6 stubs

Philippe Fremy phil at freehackers.org
Mon Aug 1 23:45:37 BST 2022


Hi Kristof,

I am part of the effort for creating high quality stubs for all PyQt 
variants.

You are correct that the default stubs provided with PyQt6 are not 
suitable for typechecking with mypy. They are provided mostly for 
type-completion.

As you found out, we have a work-in-progress project for PyQt6-stubs. 
Like many open source projects, it progresses with volonteers 
availability and recently, progress has been low on this one. I intend 
to change that during August.

Don't hesitate to file an issue over our GitHub, we will do our best to 
look into it.

Cheers,

Philippe

Le 26/07/2022 à 12:18, kristof.mulier at telenet.be a écrit :
> The mypy type checker is giving errors on every signal connection:
>
> |error: "Callable[[], None]" has no attribute "connect"|
>
> It seems like one needs PyQt6 stubs to prevent mypy from showing 
> errors like this:
>
> https://stackoverflow.com/questions/66721309/mypy-showing-callable-has-no-attribute-connect-on-every-connect-in-pyqt
>
> However, this command doesn't work (I'm on Windows 11 with Python 3.9.12):
> |> pip install PyQt6-stubs|
>
> Apparently, there are no PyQt6 stubs available yet. Is that correct? I 
> found a temporary source for PyQt6 stubs:
>
> https://github.com/python-qt-tools/PyQt6-stubs
>
> Unfortunately, mypy keeps spitting out errors for every signal 
> connection. How can I fix this?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20220802/965a9f13/attachment.htm>


More information about the PyQt mailing list