typing: Add argument type for *args

Florian Bruhin me at the-compiler.org
Sun Jul 9 01:11:58 BST 2023


Hey,

...okay, I lied. This is the last one.

There are some places in PyQt where it takes *args, namely:

    PyQt6/bindings/QtGui/qpolygon.sip
    66:    void setPoints(int firstx, int firsty, ...);
    84:    void putPoints(int index, int firstx, int firsty, ...);

    PyQt6/bindings/QtGui/qpainter.sip
    196:    void drawPoints(const QPointF *point, ...);
    210:    void drawPoints(const QPoint *point, ...);
    224:    void drawLines(const QLineF *line, ...);
    242:    void drawLines(const QPointF *pointPair, ...);
    256:    void drawLines(const QLine *line, ...);
    274:    void drawLines(const QPoint *pointPair, ...);
    288:    void drawRects(const QRectF *rect, ...);
    302:    void drawRects(const QRect *rect, ...);
    320:    void drawPolyline(const QPointF *point, ...);
    334:    void drawPolyline(const QPoint *point, ...);
    350:    void drawPolygon(const QPointF *point, ...);
    364:    void drawPolygon(const QPoint *point, ...);
    380:    void drawConvexPolygon(const QPointF *point, ...);
    394:    void drawConvexPolygon(const QPoint *point, ...);

    PyQt6/bindings/QtDBus/qdbusabstractinterface.sip
    98:    QDBusMessage call(const QString &method, ...);
    112:    QDBusMessage call(QDBus::CallMode mode, const QString &method, ...);
    176:    QDBusPendingCall asyncCall(const QString &method, ...);

Unfortunately, this results in "*a1" or "*a2" in the .pyi, without any
type information.

>From what I can see in PyQt6-stubs, those should be:

- int for QPolygon
- The same type as the first argument for QPainter
- Any for QDBusAbstractInterface
  (an explicit "Any" would be preferrable to no annotation)

Florian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20230709/a351f224/attachment.sig>


More information about the PyQt mailing list