Commit f81de8df authored by Eli Bendersky's avatar Eli Bendersky

Issue #17378: ctypes documentation fix.

Document that ctypes automatically applies byref() when argtypes declares
POINTER.
parent b9534f4e
...@@ -817,6 +817,11 @@ pointer types. So, for ``POINTER(c_int)``, ctypes accepts an array of c_int:: ...@@ -817,6 +817,11 @@ pointer types. So, for ``POINTER(c_int)``, ctypes accepts an array of c_int::
3 3
>>> >>>
In addition, if a function argument is explicitly declared to be a pointer type
(such as ``POINTER(c_int)``) in :attr:`argtypes`, an object of the pointed
type (``c_int`` in this case) can be passed to the function. ctypes will apply
the required :func:`byref` conversion in this case automatically.
To set a POINTER type field to ``NULL``, you can assign ``None``:: To set a POINTER type field to ``NULL``, you can assign ``None``::
>>> bar.values = None >>> bar.values = None
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment