datetime.rst: correct timedelta description#101417
Merged
serhiy-storchaka merged 2 commits intopython:mainfrom Feb 2, 2024
Merged
datetime.rst: correct timedelta description#101417serhiy-storchaka merged 2 commits intopython:mainfrom
serhiy-storchaka merged 2 commits intopython:mainfrom
Conversation
belm0
commented
Jan 30, 2023
Contributor
Author
|
@abalkin I think it's another straightforward datetime correction-- would you take a look? |
serhiy-storchaka
approved these changes
Feb 2, 2024
Member
serhiy-storchaka
left a comment
There was a problem hiding this comment.
LGTM.
Thank you for your contribution @belm0.
It was confusingly claimed that `timedelta` could represent the difference between two `datetime.time` objects. Subtraction of two `datetime.time` values is not allowed, nor can a `timedelta` be added to a `time`. And specifically, this conflicted text in the "timedelta Objects" section, stating "A timedelta object represents [...] the difference between two dates or times."
* list `datetime` ahead of `date`, since it's more common when
using `timedelta`
auto-merge was automatically disabled
February 2, 2024 21:20
Head branch was pushed to by a user without write access
Contributor
Author
|
I rebased-- please re-apply |
|
Thanks @belm0 for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12. |
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this pull request
Feb 2, 2024
It only represents the difference between two datetime or date objects, not between two time objects. (cherry picked from commit 73d20ca) Co-authored-by: John Belmonte <john@neggie.net>
|
GH-114938 is a backport of this pull request to the 3.12 branch. |
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this pull request
Feb 2, 2024
It only represents the difference between two datetime or date objects, not between two time objects. (cherry picked from commit 73d20ca) Co-authored-by: John Belmonte <john@neggie.net>
|
GH-114939 is a backport of this pull request to the 3.11 branch. |
serhiy-storchaka
pushed a commit
that referenced
this pull request
Feb 2, 2024
serhiy-storchaka
pushed a commit
that referenced
this pull request
Feb 2, 2024
aisk
pushed a commit
to aisk/cpython
that referenced
this pull request
Feb 11, 2024
It only represents the difference between two datetime or date objects, not between two time objects.
fsc-eriker
pushed a commit
to fsc-eriker/cpython
that referenced
this pull request
Feb 14, 2024
It only represents the difference between two datetime or date objects, not between two time objects.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It was confusingly claimed that
timedeltacould represent the difference between twodatetime.timeobjects.Subtraction of two
datetime.timevalues is not allowed, nor can atimedeltabe added to atime.