[3.12] Correct timedelta description (GH-101417) (GH-114938)

It only represents the difference between two datetime or
date objects, not between two time objects.
(cherry picked from commit 73d20cafb5)

Co-authored-by: John Belmonte <john@neggie.net>
This commit is contained in:
Miss Islington (bot) 2024-02-02 22:48:44 +01:00 committed by GitHub
parent dee56434b5
commit 1eb873ef45
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -130,8 +130,8 @@ Available Types
.. class:: timedelta .. class:: timedelta
:noindex: :noindex:
A duration expressing the difference between two :class:`date`, :class:`.time`, A duration expressing the difference between two :class:`.datetime`
or :class:`.datetime` instances to microsecond resolution. or :class:`date` instances to microsecond resolution.
.. class:: tzinfo .. class:: tzinfo
@ -203,7 +203,7 @@ objects.
-------------------------- --------------------------
A :class:`timedelta` object represents a duration, the difference between two A :class:`timedelta` object represents a duration, the difference between two
dates or times. :class:`.datetime` or :class:`date` instances.
.. class:: timedelta(days=0, seconds=0, microseconds=0, milliseconds=0, minutes=0, hours=0, weeks=0) .. class:: timedelta(days=0, seconds=0, microseconds=0, milliseconds=0, minutes=0, hours=0, weeks=0)