Skip to content

Commit d20f0ff

Browse files
uatachmiss-islington
authored andcommitted
pythongh-85453: Improve variable mark up for datetime.rst (pythonGH-120702)
Variables and literals are marked up using backticks. (cherry picked from commit 2a5cdb2) Co-authored-by: edson duarte <[email protected]>
1 parent 86296bb commit d20f0ff

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

Doc/library/datetime.rst

+17-17
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

@@ -678,7 +678,7 @@ Instance methods:
678678
.. method:: date.toordinal()
679679

680680
Return the proleptic Gregorian ordinal of the date, where January 1 of year 1
681-
has ordinal 1. For any :class:`date` object *d*,
681+
has ordinal 1. For any :class:`date` object ``d``,
682682
``date.fromordinal(d.toordinal()) == d``.
683683

684684

@@ -730,7 +730,7 @@ Instance methods:
730730

731731
.. method:: date.__str__()
732732

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

735735

736736
.. method:: date.ctime()
@@ -1011,7 +1011,7 @@ Other constructors, all class methods:
10111011
is used. If the *date* argument is a :class:`.datetime` object, its time components
10121012
and :attr:`.tzinfo` attributes are ignored.
10131013

1014-
For any :class:`.datetime` object *d*,
1014+
For any :class:`.datetime` object ``d``,
10151015
``d == datetime.combine(d.date(), d.time(), d.tzinfo)``.
10161016

10171017
.. versionchanged:: 3.6
@@ -1200,11 +1200,11 @@ Supported operations:
12001200

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

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

@@ -1377,11 +1377,11 @@ Instance methods:
13771377

13781378
.. method:: datetime.utctimetuple()
13791379

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

1384-
If *d* is aware, *d* is normalized to UTC time, by subtracting
1384+
If ``d`` is aware, ``d`` is normalized to UTC time, by subtracting
13851385
``d.utcoffset()``, and a :class:`time.struct_time` for the
13861386
normalized time is returned. :attr:`!tm_isdst` is forced to 0. Note
13871387
that an :exc:`OverflowError` may be raised if ``d.year`` was
@@ -1529,7 +1529,7 @@ Instance methods:
15291529

15301530
.. method:: datetime.__str__()
15311531

1532-
For a :class:`.datetime` instance *d*, ``str(d)`` is equivalent to
1532+
For a :class:`.datetime` instance ``d``, ``str(d)`` is equivalent to
15331533
``d.isoformat(' ')``.
15341534

15351535

@@ -1776,7 +1776,7 @@ Instance attributes (read-only):
17761776
.. versionadded:: 3.6
17771777

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

17811781
Naive and aware :class:`!time` objects are never equal.
17821782
Order comparison between naive and aware :class:`!time` objects raises
@@ -1904,7 +1904,7 @@ Instance methods:
19041904

19051905
.. method:: time.__str__()
19061906

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

19091909

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

0 commit comments

Comments
 (0)