Skip to content

Commit

Permalink
Document all valid types for _as_parameter_
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasr8 committed Jul 29, 2023
1 parent f2abeb5 commit 2d754ff
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Doc/library/ctypes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -400,9 +400,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):
Expand Down

0 comments on commit 2d754ff

Please sign in to comment.