Skip to content

Commit 35bc090

Browse files
Benedikt's Doc suggestions
1 parent ccabadf commit 35bc090

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

Doc/library/time.rst

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -586,18 +586,16 @@ Functions
586586

587587
.. function:: strptime(string[, format])
588588

589-
Parse a string representing a time according to a format. The return value
590-
is a :class:`struct_time` as returned by :func:`gmtime` or
591-
:func:`localtime`.
589+
Parse a string representing a time according to a format string. The return
590+
value is a :class:`struct_time` as returned by :func:`gmtime` or :func:`localtime`.
592591

593592
The *format* parameter uses the same directives as those used by
594593
:func:`strftime`; it defaults to ``"%a %b %d %H:%M:%S %Y"`` which matches the
595-
formatting returned by :func:`ctime`. If *string* cannot be parsed according
596-
to *format*, or if it has excess data after parsing, :exc:`ValueError` is
597-
raised. :exc:`ValueError` is raised if digits are not ASCII. The default
598-
values used to fill in any missing data when more accurate values cannot be
599-
inferred are ``(1900, 1, 1, 0, 0, 0, 0, 1, -1)``. Both *string* and *format*
600-
must be strings.
594+
formatting returned by :func:`ctime`.
595+
If *string* cannot be parsed according to *format*, if it has excess data
596+
after parsing, or if digits are not ASCII, a :exc:`ValueError` is raised. The
597+
default values, ``(1900, 1, 1, 0, 0, 0, 0, 1, -1)``, are used to fill in any
598+
missing data when more accurate values cannot be inferred.
601599

602600
For example:
603601

Doc/whatsnew/3.14.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -505,10 +505,11 @@ datetime
505505
(Contributed by Wannes Boeykens in :gh:`41431`.)
506506

507507
* The :meth:`datetime.date.strptime`, :meth:`datetime.datetime.strptime` and
508-
:meth:`datetime.time.strptime` methods now only accept ASCII digits, will and
508+
:meth:`datetime.time.strptime` methods now only accept ASCII digits and
509509
raise a :exc:`ValueError` if non-ASCII digits are specified.
510510
(Contributed by Stan Ulbrych in :gh:`131008`.)
511511

512+
512513
decimal
513514
-------
514515

@@ -887,7 +888,7 @@ sys.monitoring
887888
time
888889
----
889890

890-
* The :meth:`time.strptime`, now only accept ASCII digits, and will raise a
891+
* The :meth:`time.strptime`, now only accept ASCII digits and raise a
891892
:exc:`ValueError` if non-ASCII digits are specified.
892893
(Contributed by Stan Ulbrych in :gh:`131008`.)
893894

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
:meth:`datetime.date.strptime`, :meth:`datetime.datetime.strptime` and
2-
:meth:`datetime.time.strptime` now only accept ASCII digits.
1+
:meth:`datetime.date.strptime`, :meth:`datetime.datetime.strptime`,
2+
:meth:`datetime.time.strptime` and :meth:`time.strptime` now only accept ASCII
3+
digits.

0 commit comments

Comments
 (0)