Uh oh!
There was an error while loading. Please reload this page.
gh-94808: cover PyFunction_GetDefaults and PyFunction_SetDefaults - #98449
Conversation
sobolevn
commented
Oct 20, 2022
There's a difference with staticPyObject*func_get_defaults(PyFunctionObject*op, void*Py_UNUSED(ignored))
{
if (PySys_Audit("object.__getattr__", "Os", op, "__defaults__") <0) {
returnNULL;
}
if (op->func_defaults==NULL) {
Py_RETURN_NONE;
}
Py_INCREF(op->func_defaults);
returnop->func_defaults;
} |
| { | ||
| PyObject *defaults = PyFunction_GetDefaults(func); | ||
| if (defaults != NULL) { | ||
| Py_INCREF(defaults); |
There was a problem hiding this comment.
This is correct because PyFunction_GetDefaults returns a borrowed ref.
miss-islington
commented
Oct 27, 2022
Thanks @sobolevn for the PR, and @JelleZijlstra for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10. |
miss-islington
commented
Oct 27, 2022
Thanks @sobolevn for the PR, and @JelleZijlstra for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11. |
miss-islington
commented
Oct 27, 2022
Sorry, @sobolevn and @JelleZijlstra, I could not cleanly backport this to |
miss-islington
commented
Oct 27, 2022
Sorry @sobolevn and @JelleZijlstra, I had trouble checking out the |
miss-islington
commented
Oct 27, 2022
Thanks @sobolevn for the PR, and @JelleZijlstra for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11. |
miss-islington
commented
Oct 27, 2022
Sorry, @sobolevn and @JelleZijlstra, I could not cleanly backport this to |
Uh oh!
There was an error while loading. Please reload this page.