Details
-
Suggestion
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
None
-
None
Description
Reported from PySide6-stubs
QPolygon operator << has incorrect return type.
The following should be correctly type-checked but is not:
point = QPoint()
point_list = [point]
polygon = QPolygon()
polygon << point << point
polygon << [point, point] << [point, point] << (point, point) << (point, point)
Current signature is:
@typing.overload
def _lshift(self, arg_1: PySide6.QtCore.QPoint, /) -> None: ...
@typing.overload
def _lshift(self, arg_1: typing.Sequence[PySide6.QtCore.QPoint], /) -> None: ...
It works correctly if we change it to:
@overload
def _lshift(self, arg_1: PySide6.QtCore.QPoint) -> PySide6.QtGui.QPolygon: ...
@overload
def _lshift(self, arg_1: Sequence[PySide6.QtCore.QPoint]) -> PySide6.QtGui.QPolygon: ...
Note that the same fix should be done to QPolygonF