8000 [3.12] gh-107659: Improve wording of the description of `ctypes.pointer` and `ctypes.POINTER` (GH-107769) by miss-islington · Pull Request #108163 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

[3.12] gh-107659: Improve wording of the description of ctypes.pointer and ctypes.POINTER (GH-107769) #108163

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
gh-107659: Improve wording of the description of ctypes.pointer and…
… `ctypes.POINTER` (GH-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
commit 9db668f02a7ea966685832987f5a54508d9290ff
14 changes: 7 additions & 7 deletions Doc/library/ctypes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2029,17 +2029,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