Details
-
Bug
-
Resolution: Fixed
-
Not Evaluated
-
6.8.0
-
None
-
8a416e88c (dev), 29fb43f5b (dev), 6792f387e (6.8), c0edf645f (6.8)
Description
Windows:
> more __init__.py | findstr __version__
__version__ = "6.8.0"
> more QtWidgets.pyi | findstr addItem | findstr userData
def addItem(self, text: str, userData: typing.Any = ...) -> None: ...
def addItem(self, icon: PySide6.QtGui.QIcon | PySide6.QtGui.QPixmap, text: str, userData: typing.Any = ...) -> None: ...
Linux:
$ grep __version__ __init__.py
__version__ = "6.8.0"
$ grep addItem QtWidgets.pyi | grepuserData
def addItem(self, icon: PySide6.QtGui.QIcon | PySide6.QtGui.QPixmap, text: str, userData: typing.Any = ...) -> None: ...
def addItem(self, text: str, userData: typing.Any = ...) -> None: ...
Why is this a problem?
from typing import Any, overload, override from PySide6.QtGui import QIcon, QPixmap from PySide6.QtWidgets import QComboBox class TypeChecksOnLinux(QComboBox): @overload def addItem(self, icon: QIcon | QPixmap, text: str, data: Any = ...) -> None: ... @overload def addItem(self, text: str, data: Any = ...) -> None: ... @override def addItem(self, *args: Any, **kwargs: Any) -> None: ... class TypeChecksWindows(QComboBox): @overload def addItem(self, text: str, data: Any = ...) -> None: ... @overload def addItem(self, icon: QIcon | QPixmap, text: str, data: Any = ...) -> None: ... @override def addItem(self, *args: Any, **kwargs: Any) -> None: ...
Windows:
> mypy bug.py bug.py:8: error: Signature of "addItem" incompatible with supertype "QComboBox" [override] bug.py:8: note: Superclass: bug.py:8: note: @overload bug.py:8: note: def addItem(self, text: str, userData: Any = ...) -> None bug.py:8: note: @overload bug.py:8: note: def addItem(self, icon: QIcon | QPixmap, text: str, userData: Any = ...) -> None bug.py:8: note: Subclass: bug.py:8: note: @overload bug.py:8: note: def addItem(self, icon: QIcon | QPixmap, text: str, data: Any = ...) -> None bug.py:8: note: @overload bug.py:8: note: def addItem(self, text: str, data: Any = ...) -> None Found 1 error in 1 file (checked 1 source file)
Linux:
$ mypy bug.py bug.py:19: error: Signature of "addItem" incompatible with supertype "QComboBox" [override] bug.py:19: note: Superclass: bug.py:19: note: @overload bug.py:19: note: def addItem(self, icon: QIcon | QPixmap, text: str, userData: Any = ...) -> None bug.py:19: note: @overload bug.py:19: note: def addItem(self, text: str, userData: Any = ...) -> None bug.py:19: note: Subclass: bug.py:19: note: @overload bug.py:19: note: def addItem(self, text: str, data: Any = ...) -> None bug.py:19: note: @overload bug.py:19: note: def addItem(self, icon: QIcon | QPixmap, text: str, data: Any = ...) -> None Found 1 error in 1 file (checked 1 source file)
Attachments
For Gerrit Dashboard: PYSIDE-2886 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
592780,36 | type hints: Evaluate multiple signatures and Union Expressions | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
595531,25 | type hints: Install a permanent test for error-free pyi files | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
598203,2 | type hints: Evaluate multiple signatures and Union Expressions | 6.8 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
598206,2 | type hints: Install a permanent test for error-free pyi files | 6.8 | pyside/pyside-setup | Status: MERGED | +2 | 0 |