-
-
Notifications
You must be signed in to change notification settings - Fork 31k
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
Argument Clinic does not increase NoneType refcount when returning NoneType from a function with no parameters #95007
Comments
It has confusing semantic which does not provide any benefit (the only difference is that you should write "return Py_None" instead of "Py_RETURN_NONE"), it is not currently used, and it is broken.
Good catch. This converter is not used, so the bug was not exposed. And since it has dubious semantic (requires returning a weak reference to None on success), I think that it is better to remove it. |
How about we'll get rid of the callback return value, and use |
When I did the same in gh-91284, I found that |
It has confusing semantic which does not provide any benefit (the only difference is that you should write "return Py_None" instead of "Py_RETURN_NONE"), it is not currently used, and it is broken.
…inic Doc NoneType return converter was removed in 74b5e4c
…ent Clinic Doc (python/cpython#95529) The converter was removed in python/cpython@74b5e4c
…ent Clinic Doc (python/cpython#95529) The converter was removed in python/cpython@74b5e4c
Bug report
will produce this function:
while
function_impl
returnsPy_None
(as it should, if using NoneType return converter), refcount is not increased.here is a working example of NoneType return converter:
Generation also fails when generating a function with a single
object
parameter.It seems like the problem is with
default_return_converter
in clinic.py, being set toTrue
The text was updated successfully, but these errors were encountered: