You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Harmonize parameter names in the time module documentation and docstrings #155787
@StanFromIreland noticed in the review of GH-155513 that the parameter names in the time module documentation differ from the names used in the docstrings.
function
Doc/library/time.rst
docstring
asctime
asctime([t])
asctime([tuple])
ctime
ctime([secs])
ctime(seconds)
gmtime
gmtime([secs])
gmtime([seconds])
localtime
localtime([secs])
localtime([seconds])
mktime
mktime(t)
mktime(tuple)
sleep
sleep(secs)
sleep(seconds)
strftime
strftime(format[, t])
strftime(format[, tuple])
All these parameters are positional-only, so the names are not part of the API, but they should not contradict each other.
After GH-155513 they are no longer just a text in the docstring: asctime, ctime, gmtime, localtime and mktime get a real signature, and the METH_O mktime and sleep no longer report the generic ($self, object, /). time_tuple is used there instead of tuple, which shadows a builtin.
There are also two inconsistencies inside the docstrings themselves: the seconds argument of ctime is optional, and the format argument of strptime is optional (it defaults to "%a %b %d %H:%M:%S %Y"), but neither is shown in brackets.
Activity
gh-155787: Harmonize parameter names in the time module documentation…
SparshGarg999 commentedon Aug 15, 2026
Harmonize parameter names in time module documentation (pythongh-155787)
pythongh-155787: Add NEWS.d entry for time module documentation param…
[3.14] gh-155787: Harmonize parameter names in the time module docume…
[3.13] gh-155787: Harmonize parameter names in the time module docume…
[3.15] gh-155787: Harmonize parameter names in the time module docume…