Details
-
Bug
-
Resolution: Fixed
-
P4: Low
-
6.5.0
-
None
-
Python 3.11
-
-
551e6d68e (dev), a31777a69 (6.5)
Description
QtCore.pyi has this type stub for QCoreApplication:
class QCoreApplication(PySide6.QtCore.QObject):
}}{{# ...
@staticmethod
def translate(context: bytes, key: bytes, disambiguation: Optional[bytes] = ..., n: int = ...) -> str: ...
Actually passing a bytes argument causes a runtime error, while passing in a str is rejected by the type checker, but works fine at runtime.
The same issue apparently already existed for QObject: https://bugreports.qt.io/browse/PYSIDE-1329
Expected is to have the arguments properly declared as str in the type stubs.
Attachments
Issue Links
- relates to
-
PYSIDE-1329 QObject.tr() function parameters is not consistent with python stubs
- Closed
-
PYSIDE-2331 Misleading type error for QMetaObject.indexOfMethod
- Closed