Hi,

If you are into using type annotations for your python programs, you have certainly been disappointed by the typing stubs delivered by Qt. The official version fails to detect many errors and reports many errors for perfectly valid code.

But things are changing: I have started a PySide2-stubs package. The first version is already available at pypi (https://pypi.org/project/PySide2-stubs/ ).

The package provides updated typing information for all of PySide2. It fixes some very basic typing issues:
- 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

The current version is already useful but still has many wrong types declared (all QFlags are declared with a wrong type for example). I'll continue working on it until I get something reasonably usable.

Don't hesitate to join the effort if you like typed python code.

Have a nice day,

Philippe

_______________________________________________
PySide mailing list
PySide@qt-project.org
https://lists.qt-project.org/listinfo/pyside

Reply via email to