mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
gh-107659: Improve wording of the description of ctypes.pointer
and ctypes.POINTER
(#107769)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Co-authored-by: Kumar Aditya <kumaraditya@python.org>
This commit is contained in:
parent
1a713eac47
commit
beffb30dc7
1 changed files with 7 additions and 7 deletions
|
@ -2029,17 +2029,17 @@ Utility functions
|
||||||
specifying an address, or a ctypes instance.
|
specifying an address, or a ctypes instance.
|
||||||
|
|
||||||
|
|
||||||
.. function:: POINTER(type)
|
.. function:: POINTER(type, /)
|
||||||
|
|
||||||
This factory function creates and returns a new ctypes pointer type. Pointer
|
Create and return a new ctypes pointer type. Pointer types are cached and
|
||||||
types are cached and reused internally, so calling this function repeatedly is
|
reused internally, so calling this function repeatedly is cheap.
|
||||||
cheap. *type* must be a ctypes type.
|
*type* must be a ctypes type.
|
||||||
|
|
||||||
|
|
||||||
.. function:: pointer(obj)
|
.. function:: pointer(obj, /)
|
||||||
|
|
||||||
This function creates a new pointer instance, pointing to *obj*. The returned
|
Create a new pointer instance, pointing to *obj*.
|
||||||
object is of the type ``POINTER(type(obj))``.
|
The returned object is of the type ``POINTER(type(obj))``.
|
||||||
|
|
||||||
Note: If you just want to pass a pointer to an object to a foreign function
|
Note: If you just want to pass a pointer to an object to a foreign function
|
||||||
call, you should use ``byref(obj)`` which is much faster.
|
call, you should use ``byref(obj)`` which is much faster.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue