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

type hints: QLayoutItem spacerItem and widget can return None

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3: Somewhat important P3: Somewhat important
    • 6.10.1, 6.11.0, 6.8.5
    • 6.9.2
    • Type hints
    • None
    • All
    • dabfd4317 (6.10), cab65daa7 (tqtc/lts-6.8), 212bfa6d8 (dev)

      QLayoutItem.spacerItem and QLayoutItem.widget can return None but this is not reflected in the type hints.

      Current (incorrect) type hints

       

          def spacerItem(self, /) -> PySide6.QtWidgets.QSpacerItem: ...
          def widget(self, /) -> PySide6.QtWidgets.QWidget: ... 

      Correct type hints

          def spacerItem(self, /) -> PySide6.QtWidgets.QSpacerItem | None: ...
          def widget(self, /) -> PySide6.QtWidgets.QWidget | None: ... 

       

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

            crmaurei Cristian Maureira-Fredes
            gentlegiantjgc J C
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes