-
-
Notifications
You must be signed in to change notification settings - Fork 30.5k
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
gh-94808: add tests covering PyFunction_GetKwDefaults
and PyFunction_SetKwDefaults
#98809
gh-94808: add tests covering PyFunction_GetKwDefaults
and PyFunction_SetKwDefaults
#98809
Conversation
c85132f
to
a200c39
Compare
Lib/test/test_capi.py
Outdated
@@ -963,6 +977,8 @@ def some(pos_only='p', zero=0, optional=None): | |||
|
|||
with self.assertRaises(SystemError): | |||
_testcapi.function_set_defaults(some, 1) # not tuple or None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to check here that a failed set in fact did not change the defaults.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I see this is checked after the next failed set. But better to check every time.
PyFunction_GetKwDefaults
and PyFunction_SetKwDefaults
PyFunction_GetKwDefaults
and PyFunction_SetKwDefaults
Thanks @sobolevn for the PR, and @iritkatriel for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11. |
Sorry, @sobolevn and @iritkatriel, I could not cleanly backport this to |
There are also several changes to
PyFunction_[G|S]etDefaults
tests:Refs: #98449