Skip to content

Preserve zero-length TimeSpan periods - #959

Open
Lior Mashiach (liorma6) wants to merge 1 commit into
microsoft:mainfrom
liorma6:fix/timespan-zero-period
Open

Lior Mashiach (liorma6) wants to merge 1 commit into
microsoft:mainfrom
liorma6:fix/timespan-zero-period

Conversation

@liorma6

Copy link
Copy Markdown

TimeSpan(start=t, period=timedelta(0)) ends at the current time instead of at t. Specifying end=t with the same period raises a ValueError.

Treat zero as a duration rather than a missing value. The tests cover both endpoints, "0s", and overriding the period of an existing span.

Full test suite on Python 3.12: 1,512 passed before the fix and 1,517 after, with the same 84 skips.

@liorma6

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

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