Skip to content

Keep fold when unwrapping a datetime or time - #626

Open
SashaMIT wants to merge 1 commit into
python-poetry:masterfrom
SashaMIT:unwrap-fold
Open

SashaMIT wants to merge 1 commit into
python-poetry:masterfrom
SashaMIT:unwrap-fold

Conversation

@SashaMIT

@SashaMIT SashaMIT commented Oct 1, 2026 •

Copy link
Copy Markdown

Summary

DateTime.unwrap() and Time.unwrap() rebuilt the stdlib value without fold. A folded 01:30 then converted an hour early (timestamp() was 3600 seconds off). == still passed, because datetime equality ignores fold.

Test plan

  • pytest tests/test_items.py::test_unwrap_keeps_fold fails on master (fold is 0) and passes with this change
  • pytest tests/test_items.py (101 passed)

Agent Drafting Metadata

  • Agent: Cursor
  • Model: Grok 4.7
  • Notes:

unwrap() rebuilt the stdlib value without fold, so a folded local time converted an hour off.
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