From cbfdab14d36a851d4042a519fbda449b9db9403d Mon Sep 17 00:00:00 2001 From: Jun Komoda <45822440+junkmd@users.noreply.github.com> Date: Sun, 24 Nov 2024 02:45:16 +0000 Subject: [PATCH 1/5] Reformat paragraphs, add backquotes, and directives. --- Doc/library/ctypes.rst | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/Doc/library/ctypes.rst b/Doc/library/ctypes.rst index f490f7563b58a5..572f6a42c6bba8 100644 --- a/Doc/library/ctypes.rst +++ b/Doc/library/ctypes.rst @@ -1992,18 +1992,18 @@ Utility functions .. function:: DllCanUnloadNow() - This function is a hook which allows implementing in-process - COM servers with ctypes. It is called from the DllCanUnloadNow function that - the _ctypes extension dll exports. + This function is a hook which allows implementing in-process COM servers with + ``ctypes``. It is called from the ``DllCanUnloadNow`` function that the + ``_ctypes`` extension dll exports. .. availability:: Windows .. function:: DllGetClassObject() - This function is a hook which allows implementing in-process - COM servers with ctypes. It is called from the DllGetClassObject function - that the ``_ctypes`` extension dll exports. + This function is a hook which allows implementing in-process COM servers with + ``ctypes``. It is called from the ``DllGetClassObject`` function that the + ``_ctypes`` extension dll exports. .. availability:: Windows @@ -2035,9 +2035,9 @@ Utility functions .. function:: FormatError([code]) - Returns a textual description of the error code *code*. If no - error code is specified, the last error code is used by calling the Windows - api function GetLastError. + Returns a textual description of the error code *code*. If no error code is + specified, the last error code is used by calling the Windows api function + :func:`GetLastError`. .. availability:: Windows @@ -2142,11 +2142,10 @@ Utility functions .. function:: WinError(code=None, descr=None) - This function is probably the worst-named thing in ctypes. It - creates an instance of :exc:`OSError`. If *code* is not specified, - ``GetLastError`` is called to determine the error code. If *descr* is not - specified, :func:`FormatError` is called to get a textual description of the - error. + This function is probably the worst-named thing in ``ctypes``. It creates an + instance of :exc:`OSError`. If *code* is not specified, :func:`GetLastError` + is called to determine the error code. If *descr* is not specified, + :func:`FormatError` is called to get a textual description of the error. .. availability:: Windows From a500503150be95038ab063f0a5776f19278b88af Mon Sep 17 00:00:00 2001 From: Jun Komoda <45822440+junkmd@users.noreply.github.com> Date: Mon, 25 Nov 2024 13:41:58 +0000 Subject: [PATCH 2/5] Apply suggestions. --- Doc/library/ctypes.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Doc/library/ctypes.rst b/Doc/library/ctypes.rst index 572f6a42c6bba8..2223cbabf55f6f 100644 --- a/Doc/library/ctypes.rst +++ b/Doc/library/ctypes.rst @@ -2036,7 +2036,7 @@ Utility functions .. function:: FormatError([code]) Returns a textual description of the error code *code*. If no error code is - specified, the last error code is used by calling the Windows api function + specified, the last error code is used by calling the Windows API function :func:`GetLastError`. .. availability:: Windows @@ -2142,10 +2142,10 @@ Utility functions .. function:: WinError(code=None, descr=None) - This function is probably the worst-named thing in ``ctypes``. It creates an - instance of :exc:`OSError`. If *code* is not specified, :func:`GetLastError` - is called to determine the error code. If *descr* is not specified, - :func:`FormatError` is called to get a textual description of the error. + Creates an instance of :exc:`OSError`. If *code* is not specified, + ``GetLastError`` is called to determine the error code. If *descr* is not + specified, :func:`FormatError` is called to get a textual description of the + error. .. availability:: Windows From 0a33f3ed01902d809952175139795213e57c15e8 Mon Sep 17 00:00:00 2001 From: Jun Komoda <45822440+junkmd@users.noreply.github.com> Date: Mon, 25 Nov 2024 14:07:12 +0000 Subject: [PATCH 3/5] Add official documentation links. --- Doc/library/ctypes.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Doc/library/ctypes.rst b/Doc/library/ctypes.rst index 2223cbabf55f6f..de35ee01a8d5b0 100644 --- a/Doc/library/ctypes.rst +++ b/Doc/library/ctypes.rst @@ -1998,6 +1998,10 @@ Utility functions .. availability:: Windows + .. seealso:: + + `DllCanUnloadNow function official documentation `_ + .. function:: DllGetClassObject() @@ -2007,6 +2011,10 @@ Utility functions .. availability:: Windows + .. seealso:: + + `DllGetClassObject function official documentation `_ + .. function:: find_library(name) :module: ctypes.util From ffc4f1b29faa5947cd097668b63afdd15fc0d5d8 Mon Sep 17 00:00:00 2001 From: Jun Komoda <45822440+junkmd@users.noreply.github.com> Date: Mon, 25 Nov 2024 23:19:50 +0000 Subject: [PATCH 4/5] Add a directive. --- 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 de35ee01a8d5b0..391562dc29bf29 100644 --- a/Doc/library/ctypes.rst +++ b/Doc/library/ctypes.rst @@ -2151,7 +2151,7 @@ Utility functions .. function:: WinError(code=None, descr=None) Creates an instance of :exc:`OSError`. If *code* is not specified, - ``GetLastError`` is called to determine the error code. If *descr* is not + :func:`GetLastError` is called to determine the error code. If *descr* is not specified, :func:`FormatError` is called to get a textual description of the error. From 8d5b4e734a919a74accd9079934d8360ad7f9400 Mon Sep 17 00:00:00 2001 From: Jun Komoda <45822440+junkmd@users.noreply.github.com> Date: Wed, 27 Nov 2024 12:26:09 +0000 Subject: [PATCH 5/5] Revert `DllCanUnloadNow` and `DllGetClassObject` in `ctypes` doc. --- Doc/library/ctypes.rst | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/Doc/library/ctypes.rst b/Doc/library/ctypes.rst index 391562dc29bf29..bd9529db9ee65a 100644 --- a/Doc/library/ctypes.rst +++ b/Doc/library/ctypes.rst @@ -1992,29 +1992,21 @@ Utility functions .. function:: DllCanUnloadNow() - This function is a hook which allows implementing in-process COM servers with - ``ctypes``. It is called from the ``DllCanUnloadNow`` function that the - ``_ctypes`` extension dll exports. + This function is a hook which allows implementing in-process + COM servers with ctypes. It is called from the DllCanUnloadNow function that + the _ctypes extension dll exports. .. availability:: Windows - .. seealso:: - - `DllCanUnloadNow function official documentation `_ - .. function:: DllGetClassObject() - This function is a hook which allows implementing in-process COM servers with - ``ctypes``. It is called from the ``DllGetClassObject`` function that the - ``_ctypes`` extension dll exports. + This function is a hook which allows implementing in-process + COM servers with ctypes. It is called from the DllGetClassObject function + that the ``_ctypes`` extension dll exports. .. availability:: Windows - .. seealso:: - - `DllGetClassObject function official documentation `_ - .. function:: find_library(name) :module: ctypes.util