Repository navigation
Conversation
Parse X and x tokens into integer microseconds before splitting normalized seconds and fractions. Avoid negative-fraction errors, scientific-notation failures and float precision loss. AI assistance: OpenAI Codex.
FanWu-ai
marked this pull request as ready for review
October 11, 2026 22:26
Merging this PR will not alter performance
|
FanWu-ai
marked this pull request as draft
October 11, 2026 22:32
Use exact stdlib epoch arithmetic instead of the existing Rust local_time helper. Preserve every regression and documentation assertion, including year1 and year9999, and verify full debug-native and pure suites on Python3.10 and3.12. AI assistance: OpenAI Codex.
FanWu-ai
marked this pull request as ready for review
October 11, 2026 22:41
This branch has not been deployed
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.
Pull Request Check List
Fix
from_format('0.000001', 'X')loses the microsecond;from_format('0.000012', 'X')raisesValueError; andfrom_format('-0.1', 'X')returns.100000rather than.900000in the preceding second. Negativexmillisecond values are likewise incorrect. Float conversion also loses precision at large timestamps and can round the final valid microsecond beyond year 9999.Parse the existing X/x grammars into exact integer microseconds and obtain calendar fields with stdlib epoch-plus-timedelta arithmetic. Timezone attachment remains unchanged. Add 26 regressions/controls and timestamp documentation examples.
Validation and CI correction
The first submitted head passed full local pure-Python and release-native checks, but hosted native testing failed on the retained year-1 case. CI uses Rust's debug profile; the existing native
local_timehelper panics with unsigned overflow there, while release arithmetic wraps. This exposed a gap in the initial local build-profile coverage.The corrective commit avoids that helper using exact stdlib integer date arithmetic. Every test and documentation byte is retained, including year 1/year 9999. No Rust code, overflow settings, dependencies, skips or check configuration were changed.
Revised validation on Linux:
The unchanged skips cover Windows-only behavior and upstream timezone-transition limits. Existing INFO-level docs anchor notices and Cargo packaging diagnostics remain. Replacement hosted CI and other platforms are not claimed passed until verified. Prepared and tested with AI assistance (OpenAI Codex); no human review is claimed.