From 145b94b7eff87c9585681ba4c6c5acbcb5ccd613 Mon Sep 17 00:00:00 2001 From: Dawn Date: Wed, 16 Sep 2026 14:40:49 +0200 Subject: [PATCH] fix: suppress takeAt override complaint from newer basedpyright stubs Qt's takeAt contract is nullptr-if-out-of-range; the newer PySide stubs on CI declare a non-Optional return. Suppress rather than lie. Co-Authored-By: Claude Fable 5 --- src/aare/gui/widgets/flow_layout.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/aare/gui/widgets/flow_layout.py b/src/aare/gui/widgets/flow_layout.py index 7799bb0c..20378222 100644 --- a/src/aare/gui/widgets/flow_layout.py +++ b/src/aare/gui/widgets/flow_layout.py @@ -24,7 +24,9 @@ class FlowLayout(QLayout): def itemAt(self, index): return self._items[index] if 0 <= index < len(self._items) else None - def takeAt(self, index): + # Newer PySide stubs declare a non-Optional return, but Qt's own takeAt + # contract is "nullptr if out of range" — suppress, don't lie. + def takeAt(self, index): # pyright: ignore[reportIncompatibleMethodOverride] return self._items.pop(index) if 0 <= index < len(self._items) else None def expandingDirections(self):