I found the following issue when passing the return value of a method that should return a widget returned None instead to QLayout.addWidget().
For the following code example, all calls to addWidget result in a TypeError, except the one with None. This one causes a segmentation fault. My expectation would be that it raises a TypeError as well.
from PySide6.QtWidgets import QApplication, QHBoxLayout
app = QApplication()
layout = QHBoxLayout()
try:
layout.addWidget(1)
except TypeError:
pass
try:
layout.addWidget("foo")
except TypeError:
pass
try:
layout.addWidget(None)
except TypeError:
pass
app.quit()
- relates to
-
PYSIDE-2440 Type hints should indicate optionality
-
- Closed
-