-
-
Notifications
You must be signed in to change notification settings - Fork 32k
gh-102500: Implement PEP 688 #102521
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
gh-102500: Implement PEP 688 #102521
Changes from all commits
Commits
Show all changes
51 commits
Select commit
Hold shift + click to select a range
ca76251
try 1
JelleZijlstra 901b459
progress
JelleZijlstra c5407c7
this is better
JelleZijlstra 86f2000
this seems to work
JelleZijlstra ac10887
one more test
JelleZijlstra 2563016
Merge remote-tracking branch 'upstream/main' into pep688v2
JelleZijlstra 530a160
additions
JelleZijlstra de3a4bc
Merge remote-tracking branch 'upstream/main' into pep688v2
JelleZijlstra 116f72e
Merge remote-tracking branch 'upstream/main' into pep688v2
JelleZijlstra 207d2fd
introduce __mutable_buffer__ (rather hackily)
JelleZijlstra aee2c33
Merge remote-tracking branch 'upstream/main' into pep688v2
JelleZijlstra 007fdc1
Rip out __mutable_buffer__
JelleZijlstra 46a9239
__release_buffer__ calls mv.release()
JelleZijlstra 3020fee
Merge remote-tracking branch 'upstream/main' into pep688v2
JelleZijlstra be9bf45
additional test
JelleZijlstra a6bf0e8
undo stray change
JelleZijlstra 04d267e
Merge remote-tracking branch 'upstream/main' into pep688v2
JelleZijlstra 04d0a42
throw an error if already released
JelleZijlstra bb6d076
Merge remote-tracking branch 'upstream/main' into pep688v2
JelleZijlstra 5f755fe
Fix compiler warning
JelleZijlstra 0b02e63
news
JelleZijlstra 8e4db43
fix some tests
JelleZijlstra 6c863bc
More tests. Add flags= argument to memoryview
JelleZijlstra 3b4b7d6
Make memoryview flags arg private
JelleZijlstra f295012
regen global objects
JelleZijlstra 1660ae4
Merge remote-tracking branch 'upstream/main' into pep688v2
JelleZijlstra 0af94ac
Merge remote-tracking branch 'upstream/main' into pep688v2
JelleZijlstra b5ea908
Ignore new C globals for now
JelleZijlstra b22bfa9
not static (should not have committed this)
JelleZijlstra 69e8f7c
Use tabs not spaces
JelleZijlstra 4ca7a7c
Address Kumar's feedback
JelleZijlstra fd2d716
Merge branch 'main' into pep688v2
JelleZijlstra a70e12d
Address another piece of feedback
JelleZijlstra 96c9253
Use a classmethod instead of a new arg to the memoryview constructor
JelleZijlstra 1f7f7a0
fix typo
JelleZijlstra 7665dde
Merge branch 'main' into pep688v2
JelleZijlstra e99c188
Merge branch 'main' into pep688v2
JelleZijlstra 33691ea
Add Py_SAFE_DOWNCAST
JelleZijlstra 8f5073f
Add some test cases (thanks Shantanu)
JelleZijlstra b69dc7c
Merge remote-tracking branch 'upstream/main' into pep688v2
JelleZijlstra 9d33003
Merge remote-tracking branch 'upstream/main' into pep688v2
JelleZijlstra cecb6a5
Remove spurious global strings
JelleZijlstra 9b941a0
Merge branch 'main' into pep688v2
JelleZijlstra b22d66f
Merge branch 'main' of https://github.com/python/cpython into pep688v2
kumaraditya303 0f77bbb
fixup global objects
kumaraditya303 61f54ce
minor fixes
kumaraditya303 9f2d16b
newlines
JelleZijlstra 5e0d2de
Rename variable
JelleZijlstra b380632
Check for INT_MAX
JelleZijlstra 8502b98
Remove tp_new
JelleZijlstra b51465f
regen-all
JelleZijlstra 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#ifndef Py_INTERNAL_MEMORYOBJECT_H | ||
#define Py_INTERNAL_MEMORYOBJECT_H | ||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
#ifndef Py_BUILD_CORE | ||
# error "this header requires Py_BUILD_CORE define" | ||
#endif | ||
|
||
PyObject * | ||
PyMemoryView_FromObjectAndFlags(PyObject *v, int flags); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
#endif /* !Py_INTERNAL_MEMORYOBJECT_H */ |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
3 changes: 3 additions & 0 deletions
3
Misc/NEWS.d/next/Core and Builtins/2023-03-07-17-37-00.gh-issue-102500.RUSQhz.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,3 @@ | ||
Make the buffer protocol accessible in Python code using the new | ||
``__buffer__`` and ``__release_buffer__`` magic methods. See :pep:`688` for | ||
details. Patch by Jelle Zijlstra. |
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.