GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — gh-117764: Fix and add signatures for many builtins by serhiy-storchaka · Pull Request #117769 · python/cpython Conversation
| ||||||||||||||||||||||||||||||||||||||||||||
| PyDoc_STRVAR(memory_exit_doc, | ||
| "__exit__($self, /, *exc_info)\n--\n\n" | ||
| "Release the underlying buffer exposed by the memoryview object."); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
| 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)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
It is rather the side effect.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
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.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| @@ -3283,7 +3286,7 @@ static PyMethodDef memory_methods[] = { | |||
| MEMORYVIEW_TOREADONLY_METHODDEF | |||
| MEMORYVIEW__FROM_FLAGS_METHODDEF | |||
| {"__enter__", memory_enter, METH_NOARGS, NULL}, | |||
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
| {"__enter__", memory_enter, METH_NOARGS, NULL}, | |
| {"__enter__", memory_enter, METH_NOARGS, memory_enter_doc}, |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Co-authored-by: Erlend E. Aasland <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.