]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.11] gh-107442: Document all valid types for ctypes `_as_parameter_` (GH-107443...
authorTomas R <tomas.roun8@gmail.com>
Mon, 7 Aug 2023 14:42:19 +0000 (16:42 +0200)
committerGitHub <noreply@github.com>
Mon, 7 Aug 2023 14:42:19 +0000 (16:42 +0200)
(cherry picked from commit 6925c578a0e3cbb00858e64da813a7ffe79623c4)

Co-authored-by: Tomas R <tomas.roun8@gmail.com>
Doc/library/ctypes.rst

index b55ec32ef5af57cfbd1810386441eac0b82eb138..debc1c0adde84102b991b91c6120a029977f7c3e 100644 (file)
@@ -399,9 +399,10 @@ Calling functions with your own custom data types
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 You can also customize :mod:`ctypes` argument conversion to allow instances of
-your own classes be used as function arguments.  :mod:`ctypes` looks for an
-:attr:`_as_parameter_` attribute and uses this as the function argument.  Of
-course, it must be one of integer, string, or bytes::
+your own classes be used as function arguments. :mod:`ctypes` looks for an
+:attr:`!_as_parameter_` attribute and uses this as the function argument. The
+attribute must be an integer, string, bytes, a :mod:`ctypes` instance, or an
+object with an :attr:`!_as_parameter_` attribute::
 
    >>> class Bottles:
    ...     def __init__(self, number):