summaryrefslogtreecommitdiff
path: root/Doc/library/ctypes.rst
diff options
context:
space:
mode:
authorEli Bendersky <eliben@gmail.com>2013-03-08 05:31:54 -0800
committerEli Bendersky <eliben@gmail.com>2013-03-08 05:31:54 -0800
commit41f4f387a5a74e7d94d551ed227063936793e9dc (patch)
tree0c74d583c4d84657d968a2d3ada3c5b5b5d5c15b /Doc/library/ctypes.rst
parentf0f272e28bdfa346c33bcacd4a78df4bbf837b67 (diff)
downloadcpython-41f4f387a5a74e7d94d551ed227063936793e9dc.tar.gz
Issue #17378: ctypes documentation fix.
Document that ctypes automatically applies byref() when argtypes declares POINTER.
Diffstat (limited to 'Doc/library/ctypes.rst')
-rw-r--r--Doc/library/ctypes.rst5
1 files changed, 5 insertions, 0 deletions
diff --git a/Doc/library/ctypes.rst b/Doc/library/ctypes.rst
index 033c488f21..486c963557 100644
--- a/Doc/library/ctypes.rst
+++ b/Doc/library/ctypes.rst
@@ -817,6 +817,11 @@ pointer types. So, for ``POINTER(c_int)``, ctypes accepts an array of c_int::
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``::
>>> bar.values = None