Repository navigation
Conversation
FanWu-ai
marked this pull request as ready for review
October 19, 2026 22:02
Merging this PR will not alter performance
|
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.
A naive
DateTimecannot currently useclosest()orfarthest(), even when every candidate is naive:Candidate conversion uses the default UTC timezone, making naive candidates aware before comparing them with the naive reference. Preserve naive candidates when the reference is naive. An aware reference retains the existing UTC default for naive candidates, and already-aware candidates retain their timezone.
The tests cover both methods, Pendulum and standard-library inputs, candidate ordering, microseconds, ties, one or no candidates, subclasses, mixed-awareness rejection, and the existing aware-reference behavior. Documentation includes a naive comparison example.
Validation on Linux x86_64 / CPython 3.12.14:
PENDULUM_EXTENSIONS=0.mypy: passed over 228 source files.prek run --all-files: all hooks passed, including Rust formatting and clippy.mkdocs build --strict -f docs/mkdocs.yml: passed, retaining six existing informational anchor notices.twine check --strictpassed. All 122 production Python files in both artifacts match the tested checkout byte-for-byte.The three existing skips are one Windows-only test and two unsupported POSIX transition cases. No tests or configured checks were disabled. Other Python versions and operating systems have not been tested locally.
AI assistance: prepared and tested with OpenAI Codex.
Pull Request Check List