Skip to content

Commit

Permalink
Revert some changes to focus only on backquotes
Browse files Browse the repository at this point in the history
  • Loading branch information
uatach committed Apr 22, 2024
1 parent b4d5661 commit 8840921
Showing 1 changed file with 15 additions and 21 deletions.
36 changes: 15 additions & 21 deletions Doc/library/datetime.rst
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,10 @@ A :class:`timedelta` object represents a duration, the difference between two
Only *days*, *seconds* and *microseconds* are stored internally.
Arguments are converted to those units:

* A *millisecond* is converted to 1000 *microseconds*.
* A *minute* is converted to 60 *seconds*.
* An *hour* is converted to 3600 *seconds*.
* A *week* is converted to 7 *days*.
* A millisecond is converted to 1000 microseconds.
* A minute is converted to 60 seconds.
* An hour is converted to 3600 seconds.
* A week is converted to 7 days.

and days, seconds and microseconds are then normalized so that the
representation is unique, with
Expand Down Expand Up @@ -285,21 +285,15 @@ Note that, because of normalization, ``timedelta.max > -timedelta.min`` is true.

Instance attributes (read-only):


.. attribute:: timedelta.days

Between ``-999999999`` and ``999999999`` inclusive.


.. attribute:: timedelta.seconds

Between ``0`` and ``86399`` inclusive.


.. attribute:: timedelta.microseconds

Between ``0`` and ``999999`` inclusive.

+------------------+--------------------------------------------+
| Attribute | Value |
+==================+============================================+
| ``days`` | Between -999999999 and 999999999 inclusive |
+------------------+--------------------------------------------+
| ``seconds`` | Between 0 and 86399 inclusive |
+------------------+--------------------------------------------+
| ``microseconds`` | Between 0 and 999999 inclusive |
+------------------+--------------------------------------------+

Supported operations:

Expand Down Expand Up @@ -375,7 +369,7 @@ Notes:
This is exact and cannot overflow.

(3)
Division by ``0`` raises :exc:`ZeroDivisionError`.
Division by zero raises :exc:`ZeroDivisionError`.

(4)
``-timedelta.max`` is not representable as a :class:`timedelta` object.
Expand Down Expand Up @@ -1221,7 +1215,7 @@ Supported operations:
object *t* such that ``datetime2 + t == datetime1``. No time zone adjustments
are done in this case.

If both are aware and have different :attr:`~.datetime.tzinfo` attributes, ``a - b`` acts
If both are aware and have different :attr:`~.datetime.tzinfo` attributes, ``a-b`` acts
as if *a* and *b* were first converted to naive UTC datetimes. The
result is ``(a.replace(tzinfo=None) - a.utcoffset()) - (b.replace(tzinfo=None)
- b.utcoffset())`` except that the implementation never overflows.
Expand Down

0 comments on commit 8840921

Please sign in to comment.