Details
Description
QtCore.QCoreApplication.instance() can return None per https://doc.qt.io/qt-5/qcoreapplication.html#instance. It ought to be hinted as follows.
class QCoreApplication(PySide2.QtCore.QObject): @staticmethod def instance() -> typing.Optional["QCoreApplication"]: ...
Just because, here's the PyQt5-stubs code (just fixed today...).
@staticmethod def instance() -> typing.Optional['QCoreApplication']: ...
As always, thanks for the work on cleaning this stuff up.
Attachments
Issue Links
- relates to
-
PYSIDE-1329 QObject.tr() function parameters is not consistent with python stubs
- Closed
-
PYSIDE-2440 Type hints should indicate optionality
- Closed
For Gerrit Dashboard: PYSIDE-1467 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
354207,6 | shiboken6: Add a modification for PYI types | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
354276,2 | PySide6: Fix signature of CoreApplication.instance() | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
354927,5 | PySide6: Fix signature of CoreApplication.instance(), fix | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
354957,2 | PySide6: Fix signature of CoreApplication.instance(), fix | 6.1 | pyside/pyside-setup | Status: MERGED | +2 | 0 |