PEP561 stub files for the *PySide2/Qt5 for Python* framework
Project description
Mypy stubs for the PySide2 (Qt5 for Python)
Author : Philippe Fremy (with inspiration from the PyQt5-stubs project)
If you want to use mypy
with your PySide2
project and found the official stubs to be of insufficient quality,
you are at the right place. This project improves the official stubs delivered by Qt5 for Python/PySide2.
Improvements:
- fix Signal with method emit()
- fix qVersion() returning string, not bytes
- fix QMessageBox.warning, information, critical, question, about, aboutQt to accept None as parent argument
- fix QAction.setShortcut() to accept string as argument
- fix QTreeWidgetItem comparison with <
- fix QTimer.timeout undeclared signal
- fix QLineEdit.setText() to accept None
See CHANGELOG.md for more details.
Please note that this work is far from complete. Don't hesitate to report problems or propose improvements.
Licensing
As a derived work from PySide2, the stubs are delivered under the LGPL v2.1 . See file LICENSE for more details.
Installation
Simply install the official PySide2-stubs with pip:
$ pip install PySide2-stubs
Or use the latest version from Github:
$ pip install git+https://github.com/bluebird75/PySide2-stubs
That's it, in both cases, the new stubs are picked up automatically by mypy
. Typechecking process should be much better.
Help improve the stubs
If you notice incorrect or missing typing information (mypy reports errors eventhough your code is correct), please report it here with the following steps:
- create an issue showing your problem
- even better, create a PR to fix the problem
- make sure to add a test showing what is mistyped. Just create a file under
tests/
, with a name not starting with test. The test suite will run the file and type-check it. - fix the stubs in the PySide2-stubs directory
- and open the PR
- make sure to add a test showing what is mistyped. Just create a file under
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file PySide2-stubs-5.15.2.1.1.tar.gz
.
File metadata
- Download URL: PySide2-stubs-5.15.2.1.1.tar.gz
- Upload date:
- Size: 479.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.10.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3f2433afc5e271cbd9e237506b98050ed40979c0172b29c035691623dd036b6d |
|
MD5 | 2f9561cdf7917bc68f1ca005d83583b5 |
|
BLAKE2b-256 | d90767fa621959639600205c4b4dde694d75b1b1e96d870065aee15c0f9d9153 |
File details
Details for the file PySide2_stubs-5.15.2.1.1-py3-none-any.whl
.
File metadata
- Download URL: PySide2_stubs-5.15.2.1.1-py3-none-any.whl
- Upload date:
- Size: 516.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.10.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d39d830ffe783426bb15efc899be44aa86761b640c8f61905ea6ba99074d2407 |
|
MD5 | 0e5c0dc3bccf6a7d1a24734f5b32d639 |
|
BLAKE2b-256 | 24ce7920aa9347f37fc94a29ad96e3db978efdd0a42bad6e7f4aa1e6594320f7 |