Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
6.x, 6.8.2
-
None
-
-
f261c2ed7 (dev), 351372d3d (6.9), 575fb1bb3 (6.8)
Description
I have now started fixing type annotations in the QtWidgets.pyi stub file.
Types with a * appended are changed to have no such symbol in comments which list signal types (because Python does not have pointers) and :: are changed to . because Python uses the dot notation. I have also changed signal types listed in such comments so that QString types are str and double types are float.
Also, explicitly inheriting from object, which some classes do, is removed, since this is redundant.
Besides this, I have imported types from where it is recommended to do so, hence I imported the Sequence type from collections.abc, rather than from typing which is deprecated, and I have done the same for Callable.
What I did as well was annotating the parent parameters of about, aboutQt, critical, information, question, and warning static methods of the QMessageBox class as QWidget | None as oppose to having the current QWidget annotation, because passing None is perfectly valid and should be annotated as such.
Here's the file: QtWidgets.pyi
Attachments
For Gerrit Dashboard: PYSIDE-3021 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
637255,7 | type-hints: Correct QMessagebox annotations | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
637515,2 | type-hints: Correct QMessagebox annotations | 6.9 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
637600,2 | type-hints: Correct QMessagebox annotations | 6.8 | pyside/pyside-setup | Status: MERGED | +2 | 0 |