-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
gh-112015: Implement ctypes.memoryview_at()
#112018
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
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
236657b
Implement `ctypes.buffer_at()`
rianhunter 55d7690
Fix typo
rianhunter 00e3c23
Apply suggestions from code review
rianhunter df0f992
Make size argument a Py_ssize_t, per @serhiy-storchaka suggestion
rianhunter eaa2d13
Add what's new entry
rianhunter db3a26a
Rename buffer_at to memoryview_at
rianhunter d7e2f25
Make mutable objects the default
rianhunter 097a41c
Add test for ctypes.memoryview_at
rianhunter 4fe9b44
Merge in the main branch; move What's New entry
encukou e2c2609
TMP
encukou d39bb42
Merge in the main branch
encukou 3a6b559
Revert to calling through `ctypes` to get `c_void_p` conversion seman…
encukou 375081a
Test read-only memoryview
encukou b9e8572
Use c_ssize_t for the size
encukou 1a33fe3
Test size overflow
encukou 0198c89
Doc fixups. Don't imply that *readonly* makes the memory immutable.
encukou 6b0a8ae
Fixups
encukou e4af54f
Merge branch 'main' into ctypes-buffer-at
encukou 5600cef
Apply suggestions from code review
encukou c3c9e17
Avoid extra variable
encukou d1ca15d
Merge in the main branch
encukou d41a201
Remove unneeded line
encukou f3b1987
Merge in the main branch
encukou 82a6659
Merge in the main branch
encukou 400a62d
Remove unneeded line
encukou File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
Misc/NEWS.d/next/Library/2023-11-12-21-53-40.gh-issue-112015.2WPRxE.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
:func:`ctypes.memoryview_at` now exists to create a | ||
encukou marked this conversation as resolved.
Show resolved
Hide resolved
|
||
:class:`memoryview` object that refers to the supplied pointer and | ||
length. This works like :func:`ctypes.string_at` except it avoids a | ||
buffer copy, and is typically useful when implementing pure Python | ||
callback functions that are passed dynamically-sized buffers. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.