summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Bendersky <eliben@gmail.com>2013-03-08 13:31:54 (GMT)
committerEli Bendersky <eliben@gmail.com>2013-03-08 13:31:54 (GMT)
commitf81de8df0aca07531087b56227b730889114c524 (patch)
tree5789d566e4a9deeb1948f28160e31743999b1e25
parentb9534f4ed5cb8c78468868d2ca44769057084d83 (diff)
downloadcpython-f81de8df0aca07531087b56227b730889114c524.zip
cpython-f81de8df0aca07531087b56227b730889114c524.tar.gz
cpython-f81de8df0aca07531087b56227b730889114c524.tar.bz2
Issue #17378: ctypes documentation fix.
Document that ctypes automatically applies byref() when argtypes declares POINTER.
-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 033c488..486c963 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