From 9504d66ebe9606f009d781b6ffc20a0f0a098044 Mon Sep 17 00:00:00 2001 From: Peter Bierma Date: Mon, 19 Oct 2026 18:20:56 -0400 Subject: [PATCH] Document that zero-arg super() doesn't work with struct() --- Doc/library/ctypes.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Doc/library/ctypes.rst b/Doc/library/ctypes.rst index 6635304c35face..bafe00a6a95703 100644 --- a/Doc/library/ctypes.rst +++ b/Doc/library/ctypes.rst @@ -3675,6 +3675,12 @@ fields, or any other data types containing pointer type fields. point = Point(1, 2) + .. note:: + + Calling :func:`super` without arguments in methods of the decorated + class raises a :exc:`TypeError`. Use the two-argument form instead, for example + ``super(Point, self).__init__(x, y)``. + *align*, *layout*, and *pack* supply the value for the :attr:`~ctypes.Structure._align_`, :attr:`~ctypes.Structure._layout_`, and :attr:`~ctypes.Structure._pack_` attributes, respectively.