BUG: PyQt6 QtGui.pyi syntax error (invalid argument order '/' after '*')
Sam Steingold
sds at gnu.org
Thu Nov 5 22:40:01 GMT 2026
Hi everyone,
I encountered a syntax error inside the generated type stubs in a
recent release of PyQt6 while running mypy. The parser fails because a
positional-only argument marker (/) appears after a keyword-only
argument marker (*) in a function/method signature.
Here is the exact error messages:
mypy --install-types --non-interactive --check-untyped-defs pyapp tests
/home/sds/.virtualenvs/p314/lib/python3.14/site-packages/PyQt6/QtGui.pyi:4860:
error: '/' parameter must appear before '*' parameter [syntax]
/home/sds/.virtualenvs/p314/lib/python3.14/site-packages/PyQt6/QtGui.pyi:4864:
error: '/' parameter must appear before '*' parameter [syntax]
/home/sds/.virtualenvs/p314/lib/python3.14/site-packages/PyQt6/QtGui.pyi:4872:
error: '/' parameter must appear before '*' parameter [syntax]
/home/sds/.virtualenvs/p314/lib/python3.14/site-packages/PyQt6/QtGui.pyi:4876:
error: '/' parameter must appear before '*' parameter [syntax]
/home/sds/.virtualenvs/p314/lib/python3.14/site-packages/PyQt6/QtGui.pyi:4884:
error: '/' parameter must appear before '*' parameter [syntax]
/home/sds/.virtualenvs/p314/lib/python3.14/site-packages/PyQt6/QtGui.pyi:4888:
error: '/' parameter must appear before '*' parameter [syntax]
/home/sds/.virtualenvs/p314/lib/python3.14/site-packages/PyQt6/QtGui.pyi:4902:
error: '/' parameter must appear before '*' parameter [syntax]
/home/sds/.virtualenvs/p314/lib/python3.14/site-packages/PyQt6/QtGui.pyi:4906:
error: '/' parameter must appear before '*' parameter [syntax]
/home/sds/.virtualenvs/p314/lib/python3.14/site-packages/PyQt6/QtGui.pyi:4910:
error: '/' parameter must appear before '*' parameter [syntax]
/home/sds/.virtualenvs/p314/lib/python3.14/site-packages/PyQt6/QtGui.pyi:4914:
error: '/' parameter must appear before '*' parameter [syntax]
/home/sds/.virtualenvs/p314/lib/python3.14/site-packages/PyQt6/QtGui.pyi:4918:
error: '/' parameter must appear before '*' parameter [syntax]
/home/sds/.virtualenvs/p314/lib/python3.14/site-packages/PyQt6/QtGui.pyi:4922:
error: '/' parameter must appear before '*' parameter [syntax]
/home/sds/.virtualenvs/p314/lib/python3.14/site-packages/PyQt6/QtGui.pyi:4930:
error: '/' parameter must appear before '*' parameter [syntax]
/home/sds/.virtualenvs/p314/lib/python3.14/site-packages/PyQt6/QtGui.pyi:4934:
error: '/' parameter must appear before '*' parameter [syntax]
/home/sds/.virtualenvs/p314/lib/python3.14/site-packages/PyQt6/QtGui.pyi:5665:
error: '/' parameter must appear before '*' parameter [syntax]
/home/sds/.virtualenvs/p314/lib/python3.14/site-packages/PyQt6/QtGui.pyi:5668:
error: '/' parameter must appear before '*' parameter [syntax]
Found 16 errors in 1 file (errors prevented further checking)
Environment details:
PyQt6 6.12.0
PyQt6-Qt6 6.12.0
Python 3.14.4
mypy 2.4.1 (compiled: yes)
Looking at QtGui.pyi, the signatures are incorrectly generated like this:
def drawConvexPolygon(self, point: QtCore.QPointF|None, *args:
QtCore.QPointF, /) -> None: ...
It looks like the SIP stub generator script accidentally swapped the
order of the / and * syntax markers for this specific definition.
Swapping them manually locally or removing the malformed markers fixes
the issue.
Could this be updated or fixed in the next development snapshot/patch release?
Best regards,
--
Sam Steingold
More information about the PyQt
mailing list