@@ -122,23 +122,24 @@ An explanation of some terminology and conventions is in order.
122122Functions
123123---------
124124
125- .. function :: asctime([t ])
125+ .. function :: asctime([time_tuple ])
126126
127127 Convert a tuple or :class: `struct_time ` representing a time as returned by
128128 :func: `gmtime ` or :func: `localtime ` to a string of the following
129129 form: ``'Sun Jun 20 23:21:05 1993' ``. The day field is two characters long
130130 and is space padded if the day is a single digit,
131- e.g. : ``'Wed Jun 9 04:26:40 1993' ``.
131+ for example : ``'Wed Jun 9 04:26:40 1993' ``.
132132
133- If *t * is not provided, the current time as returned by :func: `localtime `
134- is used. Locale information is not used by :func: `asctime `.
133+ If *time_tuple * is not provided,
134+ the current time as returned by :func: `localtime ` is used.
135+ Locale information is not used by :func: `asctime `.
135136
136137 .. note ::
137138
138139 Unlike the C function of the same name, :func: `asctime ` does not add a
139140 trailing newline.
140141
141- .. function :: pthread_getcpuclockid(thread_id)
142+ .. function :: pthread_getcpuclockid(thread_id, / )
142143
143144 Return the *clk_id * of the thread-specific CPU-time clock for the specified *thread_id *.
144145
@@ -157,7 +158,7 @@ Functions
157158
158159 .. versionadded :: 3.7
159160
160- .. function :: clock_getres(clk_id)
161+ .. function :: clock_getres(clk_id, / )
161162
162163 Return the resolution (precision) of the specified clock *clk_id *. Refer to
163164 :ref: `time-clock-id-constants ` for a list of accepted values for *clk_id *.
@@ -167,7 +168,7 @@ Functions
167168 .. versionadded :: 3.3
168169
169170
170- .. function :: clock_gettime(clk_id) -> float
171+ .. function :: clock_gettime(clk_id, / ) -> float
171172
172173 Return the time of the specified clock *clk_id *. Refer to
173174 :ref: `time-clock-id-constants ` for a list of accepted values for *clk_id *.
@@ -180,7 +181,7 @@ Functions
180181 .. versionadded :: 3.3
181182
182183
183- .. function :: clock_gettime_ns(clk_id) -> int
184+ .. function :: clock_gettime_ns(clk_id, / ) -> int
184185
185186 Similar to :func: `clock_gettime ` but return time as nanoseconds.
186187
@@ -189,7 +190,7 @@ Functions
189190 .. versionadded :: 3.7
190191
191192
192- .. function :: clock_settime(clk_id, time: float)
193+ .. function :: clock_settime(clk_id, time: float, / )
193194
194195 Set the time of the specified clock *clk_id *. Currently,
195196 :data: `CLOCK_REALTIME ` is the only accepted value for *clk_id *.
@@ -202,7 +203,7 @@ Functions
202203 .. versionadded :: 3.3
203204
204205
205- .. function :: clock_settime_ns(clk_id, time: int)
206+ .. function :: clock_settime_ns(clk_id, time: int, / )
206207
207208 Similar to :func: `clock_settime ` but set time with nanoseconds.
208209
@@ -211,20 +212,20 @@ Functions
211212 .. versionadded :: 3.7
212213
213214
214- .. function :: ctime([secs] )
215+ .. function :: ctime(seconds=None, / )
215216
216217 Convert a time expressed in seconds since the epoch _ to a string of a form:
217218 ``'Sun Jun 20 23:21:05 1993' `` representing local time. The day field
218219 is two characters long and is space padded if the day is a single digit,
219- e.g. : ``'Wed Jun 9 04:26:40 1993' ``.
220+ for example : ``'Wed Jun 9 04:26:40 1993' ``.
220221
221- If *secs * is not provided or :const: `None `, the current time as
222- returned by :func: `.time ` is used. ``ctime(secs ) `` is equivalent to
223- ``asctime(localtime(secs )) ``. Locale information is not used by
222+ If *seconds * is not provided or :const: `None `, the current time as
223+ returned by :func: `.time ` is used. ``ctime(seconds ) `` is equivalent to
224+ ``asctime(localtime(seconds )) ``. Locale information is not used by
224225 :func: `ctime `.
225226
226227
227- .. function :: get_clock_info(name)
228+ .. function :: get_clock_info(name, / )
228229
229230 Get information on the specified clock as a namespace object.
230231 Supported clock names and the corresponding functions to read their value
@@ -249,21 +250,22 @@ Functions
249250 .. versionadded :: 3.3
250251
251252
252- .. function :: gmtime([secs] )
253+ .. function :: gmtime(seconds=None, / )
253254
254255 Convert a time expressed in seconds since the epoch _ to a :class: `struct_time ` in
255- UTC in which the dst flag is always zero. If *secs * is not provided or
256+ UTC in which the dst flag is always zero. If *seconds * is not provided or
256257 :const: `None `, the current time as returned by :func: `.time ` is used. Fractions
257258 of a second are ignored. See above for a description of the
258259 :class: `struct_time ` object. See :func: `calendar.timegm ` for the inverse of this
259260 function.
260261
261262
262- .. function :: localtime([secs] )
263+ .. function :: localtime(seconds=None, / )
263264
264- Like :func: `gmtime ` but converts to local time. If *secs * is not provided or
265- :const: `None `, the current time as returned by :func: `.time ` is used. The dst
266- flag is set to ``1 `` when DST applies to the given time.
265+ Like :func: `gmtime ` but converts to local time.
266+ If *seconds * is not provided or :const: `None `,
267+ the current time as returned by :func: `.time ` is used.
268+ The dst flag is set to ``1 `` when DST applies to the given time.
267269
268270 :func: `localtime ` may raise :exc: `OverflowError `, if the timestamp is
269271 outside the range of values supported by the platform C :c:func: `localtime `
@@ -272,7 +274,7 @@ Functions
272274 between 1970 and 2038.
273275
274276
275- .. function :: mktime(t )
277+ .. function :: mktime(time_tuple, / )
276278
277279 This is the inverse function of :func: `localtime `. Its argument is the
278280 :class: `struct_time ` or full 9-tuple (since the dst flag is needed; use ``-1 ``
@@ -379,7 +381,7 @@ Functions
379381
380382 .. versionadded :: 3.7
381383
382- .. function :: sleep(secs )
384+ .. function :: sleep(seconds, / )
383385
384386 Suspend execution of the calling thread for the given number of seconds.
385387 The argument may be a floating-point number to indicate a more precise sleep
@@ -393,13 +395,16 @@ Functions
393395
394396 .. rubric :: Windows implementation
395397
396- On Windows, if *secs * is zero, the thread relinquishes the remainder of its
397- time slice to any other thread that is ready to run. If there are no other
398- threads ready to run, the function returns immediately, and the thread
399- continues execution. On Windows 10 and newer the implementation uses
398+ On Windows, if *seconds * is zero,
399+ the thread relinquishes the remainder of its time slice
400+ to any other thread that is ready to run.
401+ If there are no other threads ready to run,
402+ the function returns immediately, and the thread continues execution.
403+ On Windows 10 and newer the implementation uses
400404 a `high-resolution timer
401405 <https://learn.microsoft.com/windows/win32/api/synchapi/nf-synchapi-createwaitabletimerexw> `_
402- which provides resolution of 100 nanoseconds. If *secs * is zero, ``Sleep(0) `` is used.
406+ which provides resolution of 100 nanoseconds.
407+ If *seconds * is zero, ``Sleep(0) `` is used.
403408
404409 .. rubric :: Unix implementation
405410
@@ -414,12 +419,13 @@ Functions
414419 To voluntarily relinquish the CPU, specify a real-time :ref: `scheduling
415420 policy <os-scheduling-policy>` and use :func: `os.sched_yield ` instead.
416421
417- .. audit-event :: time.sleep secs
422+ .. audit-event :: time.sleep seconds
418423
419424 .. versionchanged :: 3.5
420- The function now sleeps at least *secs * even if the sleep is interrupted
421- by a signal, except if the signal handler raises an exception (see
422- :pep: `475 ` for the rationale).
425+ The function now sleeps at least *seconds *
426+ even if the sleep is interrupted by a signal,
427+ except if the signal handler raises an exception
428+ (see :pep: `475 ` for the rationale).
423429
424430 .. versionchanged :: 3.11
425431 On Unix, the ``clock_nanosleep() `` and ``nanosleep() `` functions are now
@@ -431,13 +437,13 @@ Functions
431437.. index ::
432438 single: % (percent); datetime format
433439
434- .. function :: strftime(format[, t ])
440+ .. function :: strftime(format[, time_tuple ])
435441
436442 Convert a tuple or :class: `struct_time ` representing a time as returned by
437443 :func: `gmtime ` or :func: `localtime ` to a string as specified by the *format *
438- argument. If *t * is not provided, the current time as returned by
444+ argument. If *time_tuple * is not provided, the current time as returned by
439445 :func: `localtime ` is used. *format * must be a string. :exc: `ValueError ` is
440- raised if any field in *t * is outside of the allowed range.
446+ raised if any field in *time_tuple * is outside of the allowed range.
441447
442448 0 is a legal argument for any position in the time tuple; if it is normally
443449 illegal the value is forced to a correct one.
0 commit comments