[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: Re: PyQt6 stubs
From: Philippe Fremy <phil () freehackers ! org>
Date: 2022-08-01 22:45:37
Message-ID: 4b8cfe91-4d24-e8ae-0cdb-f0cc11bd2ba6 () freehackers ! org
[Download RAW message or body]
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@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?
[Attachment #3 (text/html)]
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<div class="moz-cite-prefix">Hi Kristof,</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">I am part of the effort for creating
high quality stubs for all PyQt variants.</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">You are correct that the default stubs
provided with PyQt6 are not suitable for typechecking with mypy.
They are provided mostly for type-completion.<br>
</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">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.</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">Don't hesitate to file an issue over
our GitHub, we will do our best to look into it.</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">Cheers,</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">Philippe<br>
</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">Le 26/07/2022 Ã 12:18,
<a class="moz-txt-link-abbreviated" \
href="mailto:kristof.mulier@telenet.be">kristof.mulier@telenet.be</a> a écrit :<br> \
</div> <blockquote type="cite"
cite="mid:527520147.245962772.1658830717103.JavaMail.zimbra@telenet.be">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div style="font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10pt; color: #000000">
<div>The mypy type checker is giving errors on every signal
connection:<br data-mce-bogus="1">
</div>
<div><br data-mce-bogus="1">
</div>
<div>
<!--StartFragment--><code>error: "Callable[[], None]" has no
attribute "connect"</code><!--EndFragment--> </div>
<div><br>
It seems like one needs PyQt6 stubs to prevent mypy from
showing errors like this:<br data-mce-bogus="1">
</div>
<div><br data-mce-bogus="1">
</div>
<div><a
href="https://stackoverflow.com/questions/66721309/mypy-showing-callable-has-no-attribute-connect-on-every-connect-in-pyqt"
moz-do-not-send="true" \
class="moz-txt-link-freetext">https://stackoverflow.com/questions/66721309/mypy-showing-callable-has-no-attribute-connect-on-every-connect-in-pyqt</a><br
data-mce-bogus="1">
</div>
<div><br data-mce-bogus="1">
</div>
<div>However, this command doesn't work (I'm on Windows 11 with
Python 3.9.12):</div>
<div>
<!--StartFragment-->
<pre class="notranslate"><code>> pip install PyQt6-stubs</code></pre>
<!--EndFragment--> </div>
<div><br data-mce-bogus="1">
</div>
<div>Apparently, there are no PyQt6 stubs available yet. Is that
correct? I found a temporary source for PyQt6 stubs:<br
data-mce-bogus="1">
</div>
<div><br data-mce-bogus="1">
</div>
<div><a href="https://github.com/python-qt-tools/PyQt6-stubs"
moz-do-not-send="true" \
class="moz-txt-link-freetext">https://github.com/python-qt-tools/PyQt6-stubs</a><br \
data-mce-bogus="1"> </div>
<div><br data-mce-bogus="1">
</div>
<div>Unfortunately, mypy keeps spitting out errors for every
signal connection. How can I fix this?<br data-mce-bogus="1">
</div>
</div>
</blockquote>
<p><br>
</p>
</body>
</html>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic