-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
gh-64376: Convert the time module to the Argument Clinic #14311
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-64376: Convert the time module to the Argument Clinic #14311
Conversation
Co-Authored-By: Nikolaus Rath <nikolaus@rath.org>
As mentioned on the BPO issue, it doesn't seem practical to use the Argument Clinic instead of the The |
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.
Needs #14330
Needs #14795 instead. |
Since pythonGH-15776, the test no longer uses time_gmtime
There are now (in current master) dedicated built-in functions to use for testing, which aren't very likely to gain Argument Clinic signatures. I suggest using import _testcapi
meth = types.MethodType(_testcapi.meth_varargs, 32)
self.assertEqual(meth(), (_testcapi, (32,))) |
This PR shouldn't change |
It no longer changes |
/*[clinic input] | ||
time.gmtime | ||
|
||
seconds: object = NULL |
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.
Maybe use a converter?
seconds: object = NULL | |
seconds as when: object(converter="object_to_time_t", type="time_t") = None |
Or introduce a named converter?
Note also that you can use None
as a default value for better signature.
time.strptime | ||
|
||
string: object | ||
format: object = NULL |
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.
format: object = NULL | |
format: object(c_default="NULL") = "%a %b %d %H:%M:%S %Y" |
{ | ||
PyObject *module, *func, *result; | ||
PyObject *mod, *func, *result; |
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.
Why rename module
?
Process time for profiling as nanoseconds: | ||
|
||
sum of the kernel and user-space CPU time. |
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 is a single sentence. Either write it in one line or make separate sentences.
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
Ping, @ZackerySpytz? |
No response since 2020. In the three years since 2020, there has been a lot of changes to Modules/timemodule.c1. I suggest to close this PR; if someone wants to pick this up, it will probably be easier to start from scratch, rather than rebasing this PR. Footnotes
|
Co-Authored-By: Nikolaus Rath nikolaus@rath.org
https://bugs.python.org/issue20177