Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9767365

Browse files
committed
Update the datetime and time section.
1 parent 3a8ae5f commit 9767365

1 file changed

Lines changed: 14 additions & 26 deletions

File tree

Doc/whatsnew/3.2.rst

Lines changed: 14 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -843,7 +843,8 @@ Example of using barriers::
843843
def get_votes(site):
844844
ballots = conduct_election(site)
845845
all_polls_closed.wait() # do not count until all polls are closed
846-
summarize(ballots)
846+
totals = summarize(ballots)
847+
publish(site, totals)
847848

848849
all_polls_closed = Barrier(len(sites))
849850
for site in sites:
@@ -864,8 +865,8 @@ a simple but thorough explanation of barriers in `The Little Book of Semaphores
864865
(Contributed by Kristján Valur Jónsson with an API review by Jeffrey Yasskin in
865866
:issue:`8777`.)
866867

867-
datetime
868-
--------
868+
datetime and time
869+
-----------------
869870

870871
* The :mod:`datetime` module has a new type :class:`~datetime.timezone` that
871872
implements the :class:`~datetime.tzinfo` interface by returning a fixed UTC
@@ -882,31 +883,18 @@ datetime
882883
:class:`float` and divided by :class:`float` and :class:`int` objects.
883884
And :class:`~datetime.timedelta` objects can now divide one another.
884885

885-
(Contributed by Alexander Belopolsky in :issue:`1289118`, :issue:`5094`,
886-
:issue:`6641`, and :issue:`2706`.)
887-
888-
.. XXX
889-
890-
* The ``strftime()`` method of :class:`~datetime.date` and
891-
:class:`~datetime.datetime` are no longer restricted to years >=
892-
1900. The new supported year range is [1000, 9999]. (Contributed
893-
by Alexander Belopolsky and Victor Stinner in :issue:`1777412`)
894-
895-
.. XXX Add a section on time module.
896-
897-
* The :func:`time.asctime` and :func:`time.ctime` functions no
898-
longer call C library asctime. (Contributed by Alexander
899-
Belopolsky in :issue:`8013`.)
886+
* The :class:`~datetime.datetime` class and the :meth:`datetime.date.strftime`
887+
method are no longer restricted to years after 1900. The new supported year
888+
range is from 1000 to 9999 inclusive.
900889

901-
* Changed the rules for using 2-digit years in time tuples. The
902-
:func:`time.asctime` and
903-
:func:`time.strftime` functions will now format any year when
904-
``time.accept2dyear`` is false and will accept years >= 1000
905-
otherwise. :func:`time.mktime` and :func:`time.strftime` now
906-
accepts full range supported by the OS. Conversion of 2-digit
907-
years to 4-digit is deprecated. (Contributed by Alexander
908-
Belopolsky and Victor Stinner in :issue:`10827`.)
890+
* The rules for two-digit years in time tuples have changed. Now, the
891+
:func:`time.asctime` and :func:`time.strftime` functions will format any year
892+
when :attr:`time.accept2dyear` is false and will accept four-digit years
893+
otherwise. The :func:`time.mktime` and :func:`time.strftime` functions now
894+
accept full range supported by the operating system. Conversion of two-digit
895+
years to four-digit is deprecated.
909896

897+
(Contributed by Alexander Belopolsky and Victor Stinner.)
910898

911899
abc
912900
---

0 commit comments

Comments
 (0)