Skip to content

gh-146236: datetime: Improve comparing datetime objects#146294

Closed
jepler wants to merge 1 commit intopython:mainfrom
jepler:issue146236
Closed

gh-146236: datetime: Improve comparing datetime objects#146294
jepler wants to merge 1 commit intopython:mainfrom
jepler:issue146236

Conversation

@jepler
Copy link
Contributor

@jepler jepler commented Mar 22, 2026

Comparing datetime objects with different fold= attributes did not preserve the documented "precedes/follows" semantics of comparisons.

Closes: #146236


📚 Documentation preview 📚: https://cpython-previews--146294.org.readthedocs.build/

Comparing datetime objects with different `fold=` attributes
did not preserve the documented "precedes/follows" semantics
of comparisons.
@jepler
Copy link
Contributor Author

jepler commented Mar 22, 2026

I'll investigate the build failures. They seem to indicate I made an error in refcounting.

@jepler
Copy link
Contributor Author

jepler commented Mar 22, 2026

Aside from the refcounting bug, I now understand that the approach of conversion to timestamp will not work, because e.g., datetime.datetime(1,1,1).timestamp() fails.

@jepler jepler closed this Mar 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

datetime: Comparision does not correctly account for folded time

1 participant