- 
    Bug 
- 
    Resolution: Fixed
- 
    P4: Low 
- 
    6.8.1
- 
    None
- 
        19d114233 (dev), 3677c9244 (6.8)
QWidgets.pyi indicates that the return type of window() is optional:
def window(self) -> PySide6.QtWidgets.QWidget | None: ...
By contrast, I think by construction of QWidget. window() can never return None: either QWidget has no parent, in which case it becomes a window and window() returns itself; or QWidget has a parent, which is another QWidget for which one of the above is true.
from PySide6.QtWidgets import QWidget, QApplication
app = QApplication()
widget = QWidget(None)
print(widget.window())
- relates to
- 
                    PYSIDE-2440 Type hints should indicate optionality -         
- Closed
 
-