gh-155496: Use Argument Clinic for more functions in the time module - #155513
Open
serhiy-storchaka wants to merge 7 commits into
Open
gh-155496: Use Argument Clinic for more functions in the time module#155513serhiy-storchaka wants to merge 7 commits into
time module#155513serhiy-storchaka wants to merge 7 commits into
Conversation
It needs a builtin function without a signature, but time.ctime() now has one.
Any builtin function can get a signature, therefore the test uses the function which exists for testing the lack of it.
serhiy-storchaka
marked this pull request as ready for review
August 14, 2026 05:16
serhiy-storchaka
requested review from
StanFromIreland,
cjw296 and
pganssle
as code owners
August 14, 2026 05:16
StanFromIreland
left a comment
Member
There was a problem hiding this comment.
Please ensure that the parameters match what is documented.
Restore the default of time.asctime() as NULL, so that passing None raises a TypeError as before, and fix the docstring of time.ctime() and the comment for parse_time_t_arg().
# Conflicts: # Modules/timemodule.c
StanFromIreland
left a comment
Member
There was a problem hiding this comment.
One little, seems fine overall. Also, since we're adding signatures for some functions I think it can get a blurb.
Restore the link between the local timezone and the value stored in os.environ['TZ'], which was lost when the docstring was split into a summary line and a body. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
time module
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Convert all functions of the
timemodule, exceptstrftime()andstrptime().The docstring of
strftime()is composed with theSTRFTIME_FORMAT_CODESmacro shared withstrptime(), which Argument Clinic cannot express, andstrptime()only forwards its arguments to_strptime._strptime_time().time(),monotonic(),perf_counter(),process_time()andthread_time()now use the "double" return converter, which makes the_PyFloat_FromPyTime()helper redundant.