]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #17378: ctypes documentation fix.
authorEli Bendersky <eliben@gmail.com>
Fri, 8 Mar 2013 13:31:54 +0000 (05:31 -0800)
committerEli Bendersky <eliben@gmail.com>
Fri, 8 Mar 2013 13:31:54 +0000 (05:31 -0800)
Document that ctypes automatically applies byref() when argtypes declares
POINTER.

Doc/library/ctypes.rst

index 033c488f21c03626499b24a88d45efe17a9a2c20..486c96355738948d5dcbacd0443339239b46debb 100644 (file)
@@ -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