From dbf6cccbba0e3180318209ff5c913e7d0d27875b Mon Sep 17 00:00:00 2001 From: Peter Jiping Xie Date: Sat, 25 Mar 2023 17:12:00 +0800 Subject: [PATCH 1/2] gh-103025: fix two ctypes doc issues (GH-103026) (cherry picked from commit 0708437ad043657f992cb985fd5c37e1ac052f93) Co-authored-by: Peter Jiping Xie --- Doc/library/ctypes.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Doc/library/ctypes.rst b/Doc/library/ctypes.rst index 282dff38c206b0..21cb0bcd00a46b 100644 --- a/Doc/library/ctypes.rst +++ b/Doc/library/ctypes.rst @@ -374,8 +374,8 @@ that they can be converted to the required C data type:: .. _ctypes-calling-variadic-functions: -Calling varadic functions -^^^^^^^^^^^^^^^^^^^^^^^^^ +Calling variadic functions +^^^^^^^^^^^^^^^^^^^^^^^^^^ On a lot of platforms calling variadic functions through ctypes is exactly the same as calling functions with a fixed number of parameters. On some platforms, and in @@ -484,7 +484,7 @@ a string pointer and a char, and returns a pointer to a string:: If you want to avoid the ``ord("x")`` calls above, you can set the :attr:`argtypes` attribute, and the second argument will be converted from a -single character Python bytes object into a C char:: +single character Python bytes object into a C char: >>> strchr.restype = c_char_p >>> strchr.argtypes = [c_char_p, c_char] From c65825423f589c25bf755a9c47efdf28f37fe5d7 Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Sat, 25 Mar 2023 09:43:27 +0000 Subject: [PATCH 2/2] Update Doc/library/ctypes.rst --- Doc/library/ctypes.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/ctypes.rst b/Doc/library/ctypes.rst index 21cb0bcd00a46b..8690f70fd2e072 100644 --- a/Doc/library/ctypes.rst +++ b/Doc/library/ctypes.rst @@ -484,7 +484,7 @@ a string pointer and a char, and returns a pointer to a string:: If you want to avoid the ``ord("x")`` calls above, you can set the :attr:`argtypes` attribute, and the second argument will be converted from a -single character Python bytes object into a C char: +single character Python bytes object into a C char:: >>> strchr.restype = c_char_p >>> strchr.argtypes = [c_char_p, c_char]