|
There's a difference with func_get_defaults: static PyObject *
func_get_defaults(PyFunctionObject *op, void *Py_UNUSED(ignored))
{
if (PySys_Audit("object.__getattr__", "Os", op, "__defaults__") < 0) {
return NULL;
}
if (op->func_defaults == NULL) {
Py_RETURN_NONE;
}
Py_INCREF(op->func_defaults);
return op->func_defaults;
}
|
Sorry, something went wrong.
| { | ||
| 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.
Sorry, something went wrong.
|
Thanks @sobolevn for the PR, and @JelleZijlstra for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10. |
Sorry, something went wrong.
|
Thanks @sobolevn for the PR, and @JelleZijlstra for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11. |
Sorry, something went wrong.
|
Sorry, @sobolevn and @JelleZijlstra, I could not cleanly backport this to 3.10 due to a conflict. |
Sorry, something went wrong.
|
Sorry @sobolevn and @JelleZijlstra, I had trouble checking out the 3.11 backport branch. |
Sorry, something went wrong.
|
Thanks @sobolevn for the PR, and @JelleZijlstra for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11. |
Sorry, something went wrong.
|
Sorry, @sobolevn and @JelleZijlstra, I could not cleanly backport this to 3.11 due to a conflict. |
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.