GeezerVison is showing github.com — bpo-47128: Enhance Argument Clinic's NoneType return converter to give `void` by arhadthedev · Pull Request #32126 · python/cpython
Conversation
arhadthedev
commented
Mar 26, 2022
•
edited by bedevere-bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
This PR makes the following possible (note that the impl has a void return type):
/*[clinic input]
_io._IOBase.writelines -> NoneType
lines: object
/
[clinic start generated code]*/
static void
_io__IOBase_writelines_impl(PyObject *self, PyObject *lines)
/*[clinic end generated code: output=f3feca36db72dbd1 input=286ba711cb7291ad]*/
Previously, the return type would be Object * and a caller would replace non-Py_None values with NULL.
So now there is no need to track whether NULL or Py_None should be returned. Or should it be Py_RETURN_NONE? Argument Clinic does it by itself returning NULL on errors and Py_None otherwise:
static PyObject *
_io__IOBase_writelines(PyObject *self, PyObject *lines)
{
PyObject *return_value = NULL;
_io__IOBase_writelines_impl(self, lines);
if (PyErr_Occurred()) {
goto exit;
}
return_value = Py_None;
Py_INCREF(Py_None);
exit:
return return_value;
}
https://bugs.python.org/issue47128
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Tests / Check if generated files are up to date fails with the following report.
make regen-deepfreeze
make[1]: Entering directory '/home/runner/work/cpython/cpython'
./_bootstrap_python ./Programs/_freeze_module.py abc ./Lib/abc.py Python/frozen_modules/abc.h
make[1]: execvp: ./_bootstrap_python: Permission denied
make[1]: *** [Makefile:1194: Python/frozen_modules/abc.h] Error 127
make[1]: Leaving directory '/home/runner/work/cpython/cpython'
make: *** [Makefile:1313: regen-global-objects] Error 2
make: *** Waiting for unfinished jobs....
All other checks pass. Reopening the PR to retrigger the checks.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
The feature calls GIL-taking PyErr_Occurred. So I close the PR until GIL is removed so performance penalty decreases.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
arhadthedev
commented
Jul 20, 2022
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|
GH-95019 fully removed the NoneType return converter. As a result, this PR has no sense to be reopened anymore.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.