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