Skip to content

Commit 6925c57

Browse files
authored
gh-107442: Document all valid types for ctypes _as_parameter_ (#107443)
1 parent a6675b1 commit 6925c57

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)