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

type hints: QObject.parent can return None

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4: Low P4: Low
    • None
    • 6.9.2
    • Type hints
    • None
    • All

      QObject.parent can return None but this is not documented in the type hints.

      Note that this probably applies to all subclasses of QObject as well.

      Current (incorrect) type hint

      def parent(self, /) -> PySide6.QtCore.QObject: ... 

      Correct type hint

      def parent(self, /) -> PySide6.QtCore.QObject | 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