Skip to content

Commit 40d2368

Browse files
committed
Refactor documentation changes
1 parent bebb241 commit 40d2368

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

Doc/library/datetime.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2617,8 +2617,6 @@ differences between platforms in handling of unsupported format specifiers.
26172617
Technical Detail
26182618
^^^^^^^^^^^^^^^^
26192619

2620-
A :exc:`ValueError` will be raised if digits are not ASCII.
2621-
26222620
Broadly speaking, ``d.strftime(fmt)`` acts like the :mod:`time` module's
26232621
``time.strftime(fmt, d.timetuple())`` although not all objects support a
26242622
:meth:`~date.timetuple` method.
@@ -2655,7 +2653,8 @@ Notes:
26552653
Because the format depends on the current locale, care should be taken when
26562654
making assumptions about the output value. Field orderings will vary (for
26572655
example, "month/day/year" versus "day/month/year"), and the output may
2658-
contain non-ASCII characters.
2656+
contain non-ASCII characters. :meth:`~.datetime.strptime` rejects non-ASCII
2657+
digits for non-locale-specific numeric format codes (e.g. `%Y`, `%H`, etc).
26592658

26602659
(2)
26612660
The :meth:`~.datetime.strptime` method can parse years in the full [1, 9999] range, but

Doc/library/time.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -431,8 +431,7 @@ Functions
431431
:func:`gmtime` or :func:`localtime` to a string as specified by the *format*
432432
argument. If *t* is not provided, the current time as returned by
433433
:func:`localtime` is used. *format* must be a string. :exc:`ValueError` is
434-
raised if any field in *t* is outside of the allowed range or if digits are
435-
not ASCII.
434+
raised if any field in *t* is outside of the allowed range.
436435

437436
0 is a legal argument for any position in the time tuple; if it is normally
438437
illegal the value is forced to a correct one.
@@ -564,6 +563,9 @@ Functions
564563
When used with the :func:`strptime` function, ``%U`` and ``%W`` are only used in
565564
calculations when the day of the week and the year are specified.
566565

566+
(5)
567+
The :func:`strptime` function does not accept non-ASCII digits for numeric values.
568+
567569
Here is an example, a format for dates compatible with that specified in the
568570
:rfc:`2822` Internet email standard. [1]_ ::
569571

0 commit comments

Comments
 (0)