Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32.3k
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
gh-102500: Implement PEP 688#102521
Changes from1 commit
Commits
Show all changes
51 commits Select commitHold shift + click to select a range
ca76251
try 1
JelleZijlstra901b459
progress
JelleZijlstrac5407c7
this is better
JelleZijlstra86f2000
this seems to work
JelleZijlstraac10887
one more test
JelleZijlstra2563016
Merge remote-tracking branch 'upstream/main' into pep688v2
JelleZijlstra530a160
additions
JelleZijlstrade3a4bc
Merge remote-tracking branch 'upstream/main' into pep688v2
JelleZijlstra116f72e
Merge remote-tracking branch 'upstream/main' into pep688v2
JelleZijlstra207d2fd
introduce __mutable_buffer__ (rather hackily)
JelleZijlstraaee2c33
Merge remote-tracking branch 'upstream/main' into pep688v2
JelleZijlstra007fdc1
Rip out __mutable_buffer__
JelleZijlstra46a9239
__release_buffer__ calls mv.release()
JelleZijlstra3020fee
Merge remote-tracking branch 'upstream/main' into pep688v2
JelleZijlstrabe9bf45
additional test
JelleZijlstraa6bf0e8
undo stray change
JelleZijlstra04d267e
Merge remote-tracking branch 'upstream/main' into pep688v2
JelleZijlstra04d0a42
throw an error if already released
JelleZijlstrabb6d076
Merge remote-tracking branch 'upstream/main' into pep688v2
JelleZijlstra5f755fe
Fix compiler warning
JelleZijlstra0b02e63
news
JelleZijlstra8e4db43
fix some tests
JelleZijlstra6c863bc
More tests. Add flags= argument to memoryview
JelleZijlstra3b4b7d6
Make memoryview flags arg private
JelleZijlstraf295012
regen global objects
JelleZijlstra1660ae4
Merge remote-tracking branch 'upstream/main' into pep688v2
JelleZijlstra0af94ac
Merge remote-tracking branch 'upstream/main' into pep688v2
JelleZijlstrab5ea908
Ignore new C globals for now
JelleZijlstrab22bfa9
not static (should not have committed this)
JelleZijlstra69e8f7c
Use tabs not spaces
JelleZijlstra4ca7a7c
Address Kumar's feedback
JelleZijlstrafd2d716
Merge branch 'main' into pep688v2
JelleZijlstraa70e12d
Address another piece of feedback
JelleZijlstra96c9253
Use a classmethod instead of a new arg to the memoryview constructor
JelleZijlstra1f7f7a0
fix typo
JelleZijlstra7665dde
Merge branch 'main' into pep688v2
JelleZijlstrae99c188
Merge branch 'main' into pep688v2
JelleZijlstra33691ea
Add Py_SAFE_DOWNCAST
JelleZijlstra8f5073f
Add some test cases (thanks Shantanu)
JelleZijlstrab69dc7c
Merge remote-tracking branch 'upstream/main' into pep688v2
JelleZijlstra9d33003
Merge remote-tracking branch 'upstream/main' into pep688v2
JelleZijlstracecb6a5
Remove spurious global strings
JelleZijlstra9b941a0
Merge branch 'main' into pep688v2
JelleZijlstrab22d66f
Merge branch 'main' of https://github.com/python/cpython into pep688v2
kumaraditya3030f77bbb
fixup global objects
kumaraditya30361f54ce
minor fixes
kumaraditya3039f2d16b
newlines
JelleZijlstra5e0d2de
Rename variable
JelleZijlstrab380632
Check for INT_MAX
JelleZijlstra8502b98
Remove tp_new
JelleZijlstrab51465f
regen-all
JelleZijlstraFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
newlines
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
commit9f2d16ba327dd3ffc5981940cb6acfac7aa50140
There are no files selected for viewing
4 changes: 4 additions & 0 deletionsLib/test/test_buffer.py
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 |
---|---|---|
@@ -4473,11 +4473,13 @@ class WhatToRelease: | ||
def __init__(self): | ||
self.held = False | ||
self.ba = bytearray(b"hello") | ||
def __buffer__(self, flags): | ||
JelleZijlstra marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
if self.held: | ||
raise TypeError("already held") | ||
self.held = True | ||
return memoryview(self.ba) | ||
def __release_buffer__(self, buffer): | ||
self.held = False | ||
@@ -4494,12 +4496,14 @@ def __init__(self): | ||
self.held = False | ||
self.ba = bytearray(b"hello") | ||
self.created_mv = None | ||
def __buffer__(self, flags): | ||
if self.held: | ||
raise TypeError("already held") | ||
self.held = True | ||
self.created_mv = memoryview(self.ba) | ||
return self.created_mv | ||
def __release_buffer__(self, buffer): | ||
assert buffer is self.created_mv | ||
self.held = False | ||
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.