Repository navigation
refactor: share PyTime conversions with time.sleep - #9362
Conversation
Move the existing conversion helper into the production time module and reuse it from sleep, preserving conversion bodies and internal C-API argument binding. Assisted-by: OpenAI Codex:model version unavailable
|
Caution Review failedThe pull request is closed. Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Merging this PR will improve performance by 11.03%
Performance Changes
Tip Curious why performance improved? Comment Comparing Footnotes
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Summary
Share the existing CPython-style PyTime conversion implementation with production
time.sleepinstead of maintaining the same conversion twice._testinternalcapi/pytime.rstotime/pytime.rsand reusefrom_seconds_object(..., Round::Up)insleep._testinternalcapiargument-binding and diagnostics, and the sleep audit, negative-duration rejection, and platform backends.Validation
test.test_time.TimeTestCase.test_sleep_exceptions: passed on a fresh, independently sealed binary. This selects only conversion-error and negative-duration cases; no positive sleeps, explicit signal delivery, thread/process creation, or full-module run. Normal interpreter/import initialization is unchanged.Local validation is based on
ef6e2dbaee626e7ea2f24900867fcd4f5aa6ab56. The patch merges cleanly with mainb7bebe638c8a44dc2a7ec90cfd6c17912ec88876; its newer memmap2/object dependency graph has not been rebuilt locally and is left to current-merge CI. The full workspace/C-API suites were not run.Source comparison uses CPython 3.15's object conversion and timeout-rounding contract. The full numerical fixture classes are unavailable on this main baseline; no skipped class is counted as coverage.
AI assistance: OpenAI Codex assisted with the extraction, source review, and validation preparation.