Skip to content

Commit 624a8e4

Browse files
[3.13] gh-85453: Improve variable mark up for datetime.rst (GH-120702) (#125490)
Variables and literals are marked up using backticks. (cherry picked from commit 2a5cdb2) Co-authored-by: edson duarte <[email protected]>
1 parent 6fb48c6 commit 624a8e4

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

Doc/library/datetime.rst

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -180,19 +180,19 @@ Objects of the :class:`date` type are always naive.
180180

181181
An object of type :class:`.time` or :class:`.datetime` may be aware or naive.
182182

183-
A :class:`.datetime` object *d* is aware if both of the following hold:
183+
A :class:`.datetime` object ``d`` is aware if both of the following hold:
184184

185185
1. ``d.tzinfo`` is not ``None``
186186
2. ``d.tzinfo.utcoffset(d)`` does not return ``None``
187187

188-
Otherwise, *d* is naive.
188+
Otherwise, ``d`` is naive.
189189

190-
A :class:`.time` object *t* is aware if both of the following hold:
190+
A :class:`.time` object ``t`` is aware if both of the following hold:
191191

192192
1. ``t.tzinfo`` is not ``None``
193193
2. ``t.tzinfo.utcoffset(None)`` does not return ``None``.
194194

195-
Otherwise, *t* is naive.
195+
Otherwise, ``t`` is naive.
196196

197197
The distinction between aware and naive doesn't apply to :class:`timedelta`
198198
objects.
@@ -358,8 +358,8 @@ Supported operations:
358358
+--------------------------------+-----------------------------------------------+
359359
| ``q, r = divmod(t1, t2)`` | Computes the quotient and the remainder: |
360360
| | ``q = t1 // t2`` (3) and ``r = t1 % t2``. |
361-
| | q is an integer and r is a :class:`timedelta` |
362-
| | object. |
361+
| | ``q`` is an integer and ``r`` is a |
362+
| | :class:`timedelta` object. |
363363
+--------------------------------+-----------------------------------------------+
364364
| ``+t1`` | Returns a :class:`timedelta` object with the |
365365
| | same value. (2) |
@@ -526,7 +526,7 @@ Other constructors, all class methods:
526526
January 1 of year 1 has ordinal 1.
527527

528528
:exc:`ValueError` is raised unless ``1 <= ordinal <=
529-
date.max.toordinal()``. For any date *d*,
529+
date.max.toordinal()``. For any date ``d``,
530530
``date.fromordinal(d.toordinal()) == d``.
531531

532532

@@ -697,7 +697,7 @@ Instance methods:
697697
.. method:: date.toordinal()
698698

699699
Return the proleptic Gregorian ordinal of the date, where January 1 of year 1
700-
has ordinal 1. For any :class:`date` object *d*,
700+
has ordinal 1. For any :class:`date` object ``d``,
701701
``date.fromordinal(d.toordinal()) == d``.
702702

703703

@@ -749,7 +749,7 @@ Instance methods:
749749

750750
.. method:: date.__str__()
751751

752-
For a date *d*, ``str(d)`` is equivalent to ``d.isoformat()``.
752+
For a date ``d``, ``str(d)`` is equivalent to ``d.isoformat()``.
753753

754754

755755
.. method:: date.ctime()
@@ -1030,7 +1030,7 @@ Other constructors, all class methods:
10301030
is used. If the *date* argument is a :class:`.datetime` object, its time components
10311031
and :attr:`.tzinfo` attributes are ignored.
10321032

1033-
For any :class:`.datetime` object *d*,
1033+
For any :class:`.datetime` object ``d``,
10341034
``d == datetime.combine(d.date(), d.time(), d.tzinfo)``.
10351035

10361036
.. versionchanged:: 3.6
@@ -1237,11 +1237,11 @@ Supported operations:
12371237

12381238
If both are naive, or both are aware and have the same :attr:`~.datetime.tzinfo` attribute,
12391239
the :attr:`~.datetime.tzinfo` attributes are ignored, and the result is a :class:`timedelta`
1240-
object *t* such that ``datetime2 + t == datetime1``. No time zone adjustments
1240+
object ``t`` such that ``datetime2 + t == datetime1``. No time zone adjustments
12411241
are done in this case.
12421242

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

@@ -1421,11 +1421,11 @@ Instance methods:
14211421

14221422
.. method:: datetime.utctimetuple()
14231423

1424-
If :class:`.datetime` instance *d* is naive, this is the same as
1424+
If :class:`.datetime` instance ``d`` is naive, this is the same as
14251425
``d.timetuple()`` except that :attr:`~.time.struct_time.tm_isdst` is forced to 0 regardless of what
14261426
``d.dst()`` returns. DST is never in effect for a UTC time.
14271427

1428-
If *d* is aware, *d* is normalized to UTC time, by subtracting
1428+
If ``d`` is aware, ``d`` is normalized to UTC time, by subtracting
14291429
``d.utcoffset()``, and a :class:`time.struct_time` for the
14301430
normalized time is returned. :attr:`!tm_isdst` is forced to 0. Note
14311431
that an :exc:`OverflowError` may be raised if ``d.year`` was
@@ -1573,7 +1573,7 @@ Instance methods:
15731573

15741574
.. method:: datetime.__str__()
15751575

1576-
For a :class:`.datetime` instance *d*, ``str(d)`` is equivalent to
1576+
For a :class:`.datetime` instance ``d``, ``str(d)`` is equivalent to
15771577
``d.isoformat(' ')``.
15781578

15791579

@@ -1820,7 +1820,7 @@ Instance attributes (read-only):
18201820
.. versionadded:: 3.6
18211821

18221822
:class:`.time` objects support equality and order comparisons,
1823-
where *a* is considered less than *b* when *a* precedes *b* in time.
1823+
where ``a`` is considered less than ``b`` when ``a`` precedes ``b`` in time.
18241824

18251825
Naive and aware :class:`!time` objects are never equal.
18261826
Order comparison between naive and aware :class:`!time` objects raises
@@ -1951,7 +1951,7 @@ Instance methods:
19511951

19521952
.. method:: time.__str__()
19531953

1954-
For a time *t*, ``str(t)`` is equivalent to ``t.isoformat()``.
1954+
For a time ``t``, ``str(t)`` is equivalent to ``t.isoformat()``.
19551955

19561956

19571957
.. method:: time.strftime(format)

0 commit comments

Comments
 (0)