Skip to content

Commit 880670a

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

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
@@ -399,9 +399,10 @@ Calling functions with your own custom data types
399399
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
400400

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

406407
>>> class Bottles:
407408
... def __init__(self, number):

0 commit comments

Comments
 (0)