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

Type hints: QLayout.takeAt can return None

XMLWordPrintable

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

      QLayout.takeAt can return None but the type hint does not reflect this.

      If there is no item at the specified location takeAt will return None.

      This applies to all subclasses of QLayout as well.

      Current (incorrect) type hint

      def takeAt(self, index: int, /) -> PySide6.QtWidgets.QLayoutItem: ... 

      Expected type hint

      def takeAt(self, index: int, /) -> PySide6.QtWidgets.QLayoutItem | None: ... 

        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