-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
datetime.rst: correct timedelta description #101417
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@abalkin I think it's another straightforward datetime correction-- would you take a look? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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`
Head branch was pushed to by a user without write access
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. |
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 <[email protected]>
GH-114938 is a backport of this pull request to the 3.12 branch. |
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 <[email protected]>
GH-114939 is a backport of this pull request to the 3.11 branch. |
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 <[email protected]>
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 <[email protected]>
It only represents the difference between two datetime or date objects, not between two time objects.
It only represents the difference between two datetime or date objects, not between two time objects.
It was confusingly claimed that
timedelta
could represent the difference between twodatetime.time
objects.Subtraction of two
datetime.time
values is not allowed, nor can atimedelta
be added to atime
.