Skip to content

gh-156263: Add the duration and timestamp converters to Argument Clinic - #156291

Draft
serhiy-storchaka wants to merge 2 commits into
python:mainfrom
serhiy-storchaka:clinic-duration-converter
Draft

gh-156263: Add the duration and timestamp converters to Argument Clinic#156291
serhiy-storchaka wants to merge 2 commits into
python:mainfrom
serhiy-storchaka:clinic-duration-converter

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Aug 23, 2026

Copy link
Copy Markdown
Member

The duration converter converts a number of seconds or milliseconds to PyTime_t or struct timeval. It supports different units, rounding modes and output types, optionally accepts None (which keeps the default value) and can reject negative values.

The timestamp converter converts a number of seconds since the epoch to time_t or PyTime_t.

They are used for the timeout parameters in the select, signal, faulthandler, _queue, _thread, _multiprocessing, socket and _sqlite3 modules and for the timestamp parameter of date.fromtimestamp(). See the NEWS entry for the resulting behavior changes.

…t Clinic

The duration converter converts a number of seconds or milliseconds to
PyTime_t or struct timeval.  The timestamp converter converts a number of
seconds since the epoch to time_t or PyTime_t.

They are used for the timeout parameters in the select, signal,
faulthandler, _queue, _thread, _multiprocessing, socket and _sqlite3
modules and for the timestamp parameter of date.fromtimestamp().

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…verter

# Conflicts:
#	Lib/test/test_clinic.py
#	Tools/clinic/libclinic/converters.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant