diff options
author | Eli Bendersky <eliben@gmail.com> | 2013-03-08 05:34:58 -0800 |
---|---|---|
committer | Eli Bendersky <eliben@gmail.com> | 2013-03-08 05:34:58 -0800 |
commit | e754636a5edf872d15d463f32429ea4c5ffb19b7 (patch) | |
tree | b2ec16dedc1098033865d9362fa101f354393091 | |
parent | 82078bcfc3ec9c3af11a8232262c043e819feb25 (diff) | |
download | cpython-git-e754636a5edf872d15d463f32429ea4c5ffb19b7.tar.gz |
Closing #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 b51ea51ca6..7f62e30561 100644 --- a/Doc/library/ctypes.rst +++ b/Doc/library/ctypes.rst @@ -816,6 +816,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 |