diff options
author | Eli Bendersky <eliben@gmail.com> | 2013-03-08 13:32:45 (GMT) |
---|---|---|
committer | Eli Bendersky <eliben@gmail.com> | 2013-03-08 13:32:45 (GMT) |
commit | f0d8697e546a46ca1ba9199e093c94be6d7de879 (patch) | |
tree | 2297bc8d5ccd6b69f6f7207c15963596837dbe9a | |
parent | 29c0034ff9ac6b006237d2251866a15c69359b27 (diff) | |
parent | f81de8df0aca07531087b56227b730889114c524 (diff) | |
download | cpython-f0d8697e546a46ca1ba9199e093c94be6d7de879.zip cpython-f0d8697e546a46ca1ba9199e093c94be6d7de879.tar.gz cpython-f0d8697e546a46ca1ba9199e093c94be6d7de879.tar.bz2 |
Issue #17378: ctypes documentation fix.
Document that ctypes automatically applies byref() when argtypes declares
POINTER.
-rw-r--r-- | Doc/library/ctypes.rst | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Doc/library/ctypes.rst b/Doc/library/ctypes.rst index 09ace46..9212d34 100644 --- a/Doc/library/ctypes.rst +++ b/Doc/library/ctypes.rst @@ -822,6 +822,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 |