Skip to content

Preserve fold in Time.replace - #1026

Open
mikamikasuki wants to merge 1 commit into
python-pendulum:masterfrom
mikamikasuki:fix/time-replace-fold
Open

mikamikasuki wants to merge 1 commit into
python-pendulum:masterfrom
mikamikasuki:fix/time-replace-fold

Conversation

@mikamikasuki

Copy link
Copy Markdown

Problem: Time.replace() discards fold, even when fold=1 is explicitly requested. Recombining the result on a fall-back date can shift the represented instant by an hour.

Fix: Preserve the existing fold when omitted and honor explicit replacements, matching datetime.time.replace(). Document the behavior.

Validation: Both native and pure Python suites passed (1,855 tests each). Six regression cases compare fold handling and UTC conversion with native time. Mypy, all hooks, native build, and strict documentation build passed.

Pull Request Check List

  • Added tests for changed code.
  • Updated documentation for changed code.

This branch has not been deployed

No deployments
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