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

type hints: QStackedLayout.widget can return None

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Not Evaluated Not Evaluated
    • None
    • 6.9.2
    • Type hints
    • None
    • All

      Both variants of QStackedLayout.widget can return None but this is not documented in the type hints.

      Current (incorrect) type hints

      @typing.overload
      def widget(self, /) -> PySide6.QtWidgets.QWidget: ...
      @typing.overload
      def widget(self, arg__1: int, /) -> PySide6.QtWidgets.QWidget: ... 

      Correct type hints

      @typing.overload
      def widget(self, /) -> PySide6.QtWidgets.QWidget | None: ...
      @typing.overload
      def widget(self, arg__1: int, /) -> PySide6.QtWidgets.QWidget | None: ... 

      The first form is inherited from QLayoutItem and the second form is implemented by QStackedLayout

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

            cinucen Ece Cinucen
            gentlegiantjgc J C
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes