Uh oh!
There was an error while loading. Please reload this page.
gh-117764: Fix and add signatures for many builtins - #117769
Merged
serhiy-storchaka merged 3 commits intoApr 12, 2024
Merged
Conversation
serhiy-storchaka
requested review from
ericsnowcurrently, iritkatriel and markshannon
as code ownersApril 11, 2024 18:26
Comment on lines
+3258
to
+3260
| PyDoc_STRVAR(memory_exit_doc, | ||
| "__exit__($self, /, *exc_info)\n--\n\n" | ||
| "Release the underlying buffer exposed by the memoryview object."); |
Contributor
There was a problem hiding this comment.
Suggested change
| PyDoc_STRVAR(memory_exit_doc, | |
| "__exit__($self, /, *exc_info)\n--\n\n" | |
| "Release the underlying buffer exposed by the memoryview object."); | |
| PyDoc_STRVAR(memory_enter_doc, | |
| "__enter__($self)\n--\n\n" | |
| "Check the underlying buffer has not been released."); | |
| PyDoc_STRVAR(memory_exit_doc, | |
| "__exit__($self, /, *exc_info)\n--\n\n" | |
| "Release the underlying buffer exposed by the memoryview object."); |
(maybe the signature for enter is not correct, it returns a reference to itself)
MemberAuthor
There was a problem hiding this comment.
It is rather the side effect.
MemberAuthor
There was a problem hiding this comment.
I left this for future. The __enter__ methods either acquire the resource, in which case it should be explicitly documented, or do not have a side effect, in which case they do not need a docstring. I am not sure what is closer to this case.
| @@ -3283,7 +3286,7 @@ static PyMethodDef memory_methods[] = { | |||
| MEMORYVIEW_TOREADONLY_METHODDEF | |||
| MEMORYVIEW__FROM_FLAGS_METHODDEF | |||
| {"__enter__", memory_enter, METH_NOARGS, NULL}, | |||
Contributor
There was a problem hiding this comment.
Suggested change
| {"__enter__", memory_enter, METH_NOARGS, NULL}, | |
| {"__enter__", memory_enter, METH_NOARGS, memory_enter_doc}, |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
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
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
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.