Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-3225

Type hints: QListWidget.itemAt() should be marked optional

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Not Evaluated Not Evaluated
    • None
    • 6.10.0
    • Type hints
    • None

      in PySide6/QtWidgets.pyi, QListView.itemAt() is declared as:

      @typing.overload
      def itemAt(self, p: PySide6.QtCore.QPoint, /) -> PySide6.QtWidgets.QListWidgetItem: ...
      @typing.overload
      def itemAt(self, x: int, y: int, /) -> PySide6.QtWidgets.QListWidgetItem: ...
      

      but should be instead:

      @typing.overload
      def itemAt(self, p: PySide6.QtCore.QPoint, /) -> PySide6.QtWidgets.QListWidgetItem | None: ...
      @typing.overload
      def itemAt(self, x: int, y: int, /) -> PySide6.QtWidgets.QListWidgetItem | None: ...
      

      adding | None to both return types.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            cinucen Ece Cinucen
            carlo.nonato Carlo Nonato
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes