Skip to content

Commit

Permalink
pythongh-107659: Improve wording of the description of `ctypes.pointe…
Browse files Browse the repository at this point in the history
…r` and `ctypes.POINTER` (pythonGH-107769)

(cherry picked from commit beffb30)

Co-authored-by: Tomas R <tomas.roun8@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
  • Loading branch information
3 people authored and miss-islington committed Aug 20, 2023
1 parent 4c042a3 commit 4956329
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Doc/library/ctypes.rst
Expand Up @@ -1988,17 +1988,17 @@ Utility functions
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
types are cached and reused internally, so calling this function repeatedly is
cheap. *type* must be a ctypes type.
Create and return a new ctypes pointer type. Pointer types are cached and
reused internally, so calling this function repeatedly is cheap.
*type* must be a ctypes type.


.. function:: pointer(obj)
.. function:: pointer(obj, /)

This function creates a new pointer instance, pointing to *obj*. The returned
object is of the type ``POINTER(type(obj))``.
Create a new pointer instance, pointing to *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
call, you should use ``byref(obj)`` which is much faster.
Expand Down

0 comments on commit 4956329

Please sign in to comment.