Skip to content

Commit e5582bd

Browse files
[3.12] gh-107442: Document all valid types for ctypes _as_parameter_ (GH-107443) (#107707)
gh-107442: Document all valid types for ctypes _as_parameter_ (GH-107443) (cherry picked from commit 6925c57) Co-authored-by: Tomas R <tomas.roun8@gmail.com>
1 parent 19863c3 commit e5582bd

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Doc/library/ctypes.rst

+4-3
Original file line numberDiff line numberDiff line change
@@ -401,9 +401,10 @@ Calling functions with your own custom data types
401401
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
402402

403403
You can also customize :mod:`ctypes` argument conversion to allow instances of
404-
your own classes be used as function arguments. :mod:`ctypes` looks for an
405-
:attr:`!_as_parameter_` attribute and uses this as the function argument. Of
406-
course, it must be one of integer, string, or bytes::
404+
your own classes be used as function arguments. :mod:`ctypes` looks for an
405+
:attr:`!_as_parameter_` attribute and uses this as the function argument. The
406+
attribute must be an integer, string, bytes, a :mod:`ctypes` instance, or an
407+
object with an :attr:`!_as_parameter_` attribute::
407408

408409
>>> class Bottles:
409410
... def __init__(self, number):

0 commit comments

Comments
 (0)