]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-107442: Document all valid types for ctypes _as_parameter_ (#107443)
authorTomas R <tomas.roun8@gmail.com>
Mon, 7 Aug 2023 10:41:39 +0000 (12:41 +0200)
committerGitHub <noreply@github.com>
Mon, 7 Aug 2023 10:41:39 +0000 (12:41 +0200)
Doc/library/ctypes.rst

index ec4b0909181d32cd25c806fa0416caefdc6c515e..fcf711efe0eb7dba34754f477cbe1a6624e14d20 100644 (file)
@@ -401,9 +401,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):