Skip to content

Commit 17947e2

Browse files
committed
Remove code formatting for 0 and 1
1 parent e111ed5 commit 17947e2

File tree

1 file changed

+28
-28
lines changed

1 file changed

+28
-28
lines changed

Doc/library/datetime.rst

+28-28
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ The :mod:`!datetime` module exports the following constants:
8585
.. data:: MINYEAR
8686

8787
The smallest year number allowed in a :class:`date` or :class:`.datetime` object.
88-
:const:`MINYEAR` is ``1``.
88+
:const:`MINYEAR` is 1.
8989

9090

9191
.. data:: MAXYEAR
@@ -207,7 +207,7 @@ A :class:`timedelta` object represents a duration, the difference between two
207207

208208
.. class:: timedelta(days=0, seconds=0, microseconds=0, milliseconds=0, minutes=0, hours=0, weeks=0)
209209

210-
All arguments are optional and default to ``0``. Arguments may be integers
210+
All arguments are optional and default to 0. Arguments may be integers
211211
or floats, and may be positive or negative.
212212

213213
Only *days*, *seconds* and *microseconds* are stored internally.
@@ -614,7 +614,7 @@ Notes:
614614

615615
(3)
616616
This is exact, and cannot overflow. ``timedelta.seconds`` and
617-
``timedelta.microseconds`` are ``0``, and ``date2 + timedelta == date1`` after.
617+
``timedelta.microseconds`` are 0, and ``date2 + timedelta == date1`` after.
618618

619619
(4)
620620
:class:`date` objects are equal if they represent the same date.
@@ -671,7 +671,7 @@ Instance methods:
671671
time.struct_time((d.year, d.month, d.day, 0, 0, 0, d.weekday(), yday, -1))
672672

673673
where ``yday = d.toordinal() - date(d.year, 1, 1).toordinal() + 1``
674-
is the day number within the current year starting with ``1`` for January 1st.
674+
is the day number within the current year starting with 1 for January 1st.
675675

676676

677677
.. method:: date.toordinal()
@@ -752,7 +752,7 @@ Instance methods:
752752
.. method:: date.strftime(format)
753753

754754
Return a string representing the date, controlled by an explicit format string.
755-
Format codes referring to hours, minutes or seconds will see ``0`` values.
755+
Format codes referring to hours, minutes or seconds will see 0 values.
756756
See also :ref:`strftime-strptime-behavior` and :meth:`date.isoformat`.
757757

758758

@@ -841,7 +841,7 @@ from a :class:`date` object and a :class:`.time` object.
841841

842842
Like a :class:`date` object, :class:`.datetime` assumes the current Gregorian
843843
calendar extended in both directions; like a :class:`.time` object,
844-
:class:`.datetime` assumes there are exactly ``3600*24`` seconds in every day.
844+
:class:`.datetime` assumes there are exactly 3600\*24 seconds in every day.
845845

846846
Constructor:
847847

@@ -945,7 +945,7 @@ Other constructors, all class methods:
945945
failure.
946946

947947
.. versionchanged:: 3.6
948-
:meth:`fromtimestamp` may return instances with :attr:`.fold` set to ``1``.
948+
:meth:`fromtimestamp` may return instances with :attr:`.fold` set to 1.
949949

950950
.. classmethod:: datetime.utcfromtimestamp(timestamp)
951951

@@ -993,7 +993,7 @@ Other constructors, all class methods:
993993
Return the :class:`.datetime` corresponding to the proleptic Gregorian ordinal,
994994
where January 1 of year 1 has ordinal 1. :exc:`ValueError` is raised unless
995995
``1 <= ordinal <= datetime.max.toordinal()``. The hour, minute, second and
996-
microsecond of the result are all ``0``, and :attr:`.tzinfo` is ``None``.
996+
microsecond of the result are all 0, and :attr:`.tzinfo` is ``None``.
997997

998998

999999
.. classmethod:: datetime.combine(date, time, tzinfo=time.tzinfo)
@@ -1167,7 +1167,7 @@ Instance attributes (read-only):
11671167
In ``[0, 1]``. Used to disambiguate wall times during a repeated interval. (A
11681168
repeated interval occurs when clocks are rolled back at the end of daylight saving
11691169
time or when the UTC offset for the current zone is decreased for political reasons.)
1170-
The values ``0`` and ``1`` represent, respectively, the earlier and later of the two
1170+
The values 0 and 1 represent, respectively, the earlier and later of the two
11711171
moments with the same wall time representation.
11721172

11731173
.. versionadded:: 3.6
@@ -1387,23 +1387,23 @@ Instance methods:
13871387
d.weekday(), yday, dst))
13881388

13891389
where ``yday = d.toordinal() - date(d.year, 1, 1).toordinal() + 1``
1390-
is the day number within the current year starting with ``1`` for January
1390+
is the day number within the current year starting with 1 for January
13911391
1st. The :attr:`~time.struct_time.tm_isdst` flag of the result is set according to the
13921392
:meth:`dst` method: :attr:`.tzinfo` is ``None`` or :meth:`dst` returns
13931393
``None``, :attr:`!tm_isdst` is set to ``-1``; else if :meth:`dst` returns a
1394-
non-zero value, :attr:`!tm_isdst` is set to ``1``; else :attr:`!tm_isdst` is
1395-
set to ``0``.
1394+
non-zero value, :attr:`!tm_isdst` is set to 1; else :attr:`!tm_isdst` is
1395+
set to 0.
13961396

13971397

13981398
.. method:: datetime.utctimetuple()
13991399

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

14041404
If *d* is aware, *d* is normalized to UTC time, by subtracting
14051405
``d.utcoffset()``, and a :class:`time.struct_time` for the
1406-
normalized time is returned. :attr:`!tm_isdst` is forced to ``0``. Note
1406+
normalized time is returned. :attr:`!tm_isdst` is forced to 0. Note
14071407
that an :exc:`OverflowError` may be raised if ``d.year`` was
14081408
``MINYEAR`` or ``MAXYEAR`` and UTC adjustment spills over a year
14091409
boundary.
@@ -1483,15 +1483,15 @@ Instance methods:
14831483

14841484
Return a string representing the date and time in ISO 8601 format:
14851485

1486-
- ``YYYY-MM-DDTHH:MM:SS.ffffff``, if :attr:`microsecond` is not ``0``
1487-
- ``YYYY-MM-DDTHH:MM:SS``, if :attr:`microsecond` is ``0``
1486+
- ``YYYY-MM-DDTHH:MM:SS.ffffff``, if :attr:`microsecond` is not 0
1487+
- ``YYYY-MM-DDTHH:MM:SS``, if :attr:`microsecond` is 0
14881488

14891489
If :meth:`utcoffset` does not return ``None``, a string is
14901490
appended, giving the UTC offset:
14911491

14921492
- ``YYYY-MM-DDTHH:MM:SS.ffffff+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond`
1493-
is not ``0``
1494-
- ``YYYY-MM-DDTHH:MM:SS+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` is ``0``
1493+
is not 0
1494+
- ``YYYY-MM-DDTHH:MM:SS+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` is 0
14951495

14961496
Examples::
14971497

@@ -1519,7 +1519,7 @@ Instance methods:
15191519
components of the time to include (the default is ``'auto'``).
15201520
It can be one of the following:
15211521

1522-
- ``'auto'``: Same as ``'seconds'`` if :attr:`microsecond` is ``0``,
1522+
- ``'auto'``: Same as ``'seconds'`` if :attr:`microsecond` is 0,
15231523
same as ``'microseconds'`` otherwise.
15241524
- ``'hours'``: Include the :attr:`hour` in the two-digit ``HH`` format.
15251525
- ``'minutes'``: Include :attr:`hour` and :attr:`minute` in ``HH:MM`` format.
@@ -1735,7 +1735,7 @@ day, and subject to adjustment via a :class:`tzinfo` object.
17351735
* ``fold in [0, 1]``.
17361736

17371737
If an argument outside those ranges is given, :exc:`ValueError` is raised. All
1738-
default to ``0`` except *tzinfo*, which defaults to :const:`None`.
1738+
default to 0 except *tzinfo*, which defaults to :const:`None`.
17391739

17401740
Class attributes:
17411741

@@ -1790,7 +1790,7 @@ Instance attributes (read-only):
17901790
In ``[0, 1]``. Used to disambiguate wall times during a repeated interval. (A
17911791
repeated interval occurs when clocks are rolled back at the end of daylight saving
17921792
time or when the UTC offset for the current zone is decreased for political reasons.)
1793-
The values ``0`` and ``1`` represent, respectively, the earlier and later of the two
1793+
The values 0 and 1 represent, respectively, the earlier and later of the two
17941794
moments with the same wall time representation.
17951795

17961796
.. versionadded:: 3.6
@@ -1885,16 +1885,16 @@ Instance methods:
18851885

18861886
Return a string representing the time in ISO 8601 format, one of:
18871887

1888-
- ``HH:MM:SS.ffffff``, if :attr:`microsecond` is not ``0``
1889-
- ``HH:MM:SS``, if :attr:`microsecond` is ``0``
1888+
- ``HH:MM:SS.ffffff``, if :attr:`microsecond` is not 0
1889+
- ``HH:MM:SS``, if :attr:`microsecond` is 0
18901890
- ``HH:MM:SS.ffffff+HH:MM[:SS[.ffffff]]``, if :meth:`utcoffset` does not return ``None``
1891-
- ``HH:MM:SS+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` is ``0`` and :meth:`utcoffset` does not return ``None``
1891+
- ``HH:MM:SS+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` is 0 and :meth:`utcoffset` does not return ``None``
18921892

18931893
The optional argument *timespec* specifies the number of additional
18941894
components of the time to include (the default is ``'auto'``).
18951895
It can be one of the following:
18961896

1897-
- ``'auto'``: Same as ``'seconds'`` if :attr:`microsecond` is ``0``,
1897+
- ``'auto'``: Same as ``'seconds'`` if :attr:`microsecond` is 0,
18981898
same as ``'microseconds'`` otherwise.
18991899
- ``'hours'``: Include the :attr:`hour` in the two-digit ``HH`` format.
19001900
- ``'minutes'``: Include :attr:`hour` and :attr:`minute` in ``HH:MM`` format.
@@ -2235,7 +2235,7 @@ to 1:00 (standard time) again. Local times of the form 1:MM are ambiguous.
22352235
:meth:`~.datetime.astimezone` mimics the local clock's behavior by mapping two adjacent UTC
22362236
hours into the same local hour then. In the Eastern example, UTC times of the
22372237
form 5:MM and 6:MM both map to 1:MM when converted to Eastern, but earlier times
2238-
have the :attr:`~.datetime.fold` attribute set to ``0`` and the later times have it set to ``1``.
2238+
have the :attr:`~.datetime.fold` attribute set to 0 and the later times have it set to 1.
22392239
For example, at the Fall back transition of 2016, we get::
22402240

22412241
>>> u0 = datetime(2016, 11, 6, 4, tzinfo=timezone.utc)
@@ -2561,11 +2561,11 @@ information, which are supported in ``datetime.strptime`` but are discarded by
25612561

25622562
For :class:`.time` objects, the format codes for year, month, and day should not
25632563
be used, as :class:`!time` objects have no such values. If they're used anyway,
2564-
``1900`` is substituted for the year, and ``1`` for the month and day.
2564+
``1900`` is substituted for the year, and 1 for the month and day.
25652565

25662566
For :class:`date` objects, the format codes for hours, minutes, seconds, and
25672567
microseconds should not be used, as :class:`date` objects have no such
2568-
values. If they're used anyway, ``0`` is substituted for them.
2568+
values. If they're used anyway, 0 is substituted for them.
25692569

25702570
For the same reason, handling of format strings containing Unicode code points
25712571
that can't be represented in the charset of the current locale is also

0 commit comments

Comments
 (0)