mirror of
https://github.com/python/cpython.git
synced 2025-09-27 02:39:58 +00:00
Closing #17378: ctypes documentation fix.
Document that ctypes automatically applies byref() when argtypes declares POINTER.
This commit is contained in:
parent
82078bcfc3
commit
e754636a5e
1 changed files with 5 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue