Skip to content

Preserve fold in datetime subtraction - #623

Merged
frostming merged 1 commit into
python-poetry:masterfrom
Boulea7:ln-cx/preserve-datetime-subtraction-fold
Sep 30, 2026
Merged

frostming merged 1 commit into
python-poetry:masterfrom
Boulea7:ln-cx/preserve-datetime-subtraction-fold

Conversation

@Boulea7

@Boulea7 Boulea7 commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

Summary

Preserve fold when reconstructing a DateTime for subtraction. A repeated-hour datetime with fold=1 now subtracts its equivalent UTC instant to zero instead of minus one hour. Follow-up to #620.

Regression tests cover both folds and confirm timedelta subtraction keeps the standard-library fold reset behavior. tests/test_items.py passes on CPython 3.11 (100 passed) and PyPy 3.12 (99 passed, 1 skipped). mypy reports the same five existing errors as clean main.

Agent Drafting Metadata

  • Agent: Codex
  • Model: GPT-6.1
  • Notes: Drafted the patch, regression tests, and PR description.

@Boulea7
Boulea7 marked this pull request as ready for review September 30, 2026 09:46
Copilot AI balanced review requested due to automatic review settings September 30, 2026 09:46

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@frostming
frostming merged commit 40dd59c into python-poetry:master Sep 30, 2026
25 checks passed
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.

3 participants