Skip to content

Commit 85dc53a

Browse files
authored
bpo-21302: Update time.sleep() doc for clock_nanosleep() (GH-28311)
Clean-up also What's New in Python 3.11 doc: move entries to the correct sections.
1 parent 85a4748 commit 85dc53a

File tree

2 files changed

+32
-19
lines changed

2 files changed

+32
-19
lines changed

Doc/library/time.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,11 @@ Functions
362362
by a signal, except if the signal handler raises an exception (see
363363
:pep:`475` for the rationale).
364364

365+
.. versionchanged:: 3.11
366+
In Unix operating systems, the ``clock_nanosleep()`` function is now
367+
used, if available: it allows to sleep for an interval specified with
368+
nanosecond precision.
369+
365370

366371
.. index::
367372
single: % (percent); datetime format

Doc/whatsnew/3.11.rst

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ Summary -- Release highlights
6666
.. PEP-sized items next.
6767
6868
69-
7069
New Features
7170
============
7271

@@ -209,8 +208,8 @@ math
209208
os
210209
--
211210

212-
* On Windows, :func:`os.urandom` uses ``BCryptGenRandom()`` instead of ``CryptGenRandom()``
213-
which is deprecated.
211+
* On Windows, :func:`os.urandom` now uses ``BCryptGenRandom()``,
212+
instead of ``CryptGenRandom()`` which is deprecated.
214213
(Contributed by Dong-hee Na in :issue:`44611`.)
215214

216215

@@ -232,6 +231,14 @@ sqlite3
232231
(Contributed by Aviv Palivoda, Daniel Shahaf, and Erlend E. Aasland in
233232
:issue:`16379`.)
234233

234+
time
235+
----
236+
237+
* In Unix operating systems, :func:`time.sleep` now uses the
238+
``clock_nanosleep()`` function, if available, which allows to sleep for an
239+
interval specified with nanosecond precision.
240+
(Contributed by Livius and Victor Stinner in :issue:`21302`.)
241+
235242

236243
Removed
237244
=======
@@ -265,6 +272,18 @@ Removed
265272
and :class:`fileinput.FileInput`, deprecated since Python 3.9.
266273
(Contributed by Hugo van Kemenade in :issue:`45132`.)
267274

275+
* The following deprecated functions and methods are removed in the :mod:`gettext`
276+
module: :func:`~gettext.lgettext`, :func:`~gettext.ldgettext`,
277+
:func:`~gettext.lngettext` and :func:`~gettext.ldngettext`.
278+
279+
Function :func:`~gettext.bind_textdomain_codeset`, methods
280+
:meth:`~gettext.NullTranslations.output_charset` and
281+
:meth:`~gettext.NullTranslations.set_output_charset`, and the *codeset*
282+
parameter of functions :func:`~gettext.translation` and
283+
:func:`~gettext.install` are also removed, since they are only used for
284+
the ``l*gettext()`` functions.
285+
(Contributed by Dong-hee Na and Serhiy Storchaka in :issue:`44235`.)
286+
268287

269288
Optimizations
270289
=============
@@ -317,6 +336,10 @@ Deprecated
317336
It is untested and undocumented and also not used by webbrowser itself.
318337
(Contributed by Dong-hee Na in :issue:`42255`.)
319338

339+
* The behavior of returning a value from a :class:`~unittest.TestCase` and
340+
:class:`~unittest.IsolatedAsyncioTestCase` test methods (other than the
341+
default ``None`` value), is now deprecated.
342+
320343

321344
Removed
322345
=======
@@ -334,6 +357,7 @@ Removed
334357
* Remove the deprecated ``split()`` method of :class:`_tkinter.TkappType`.
335358
(Contributed by Erlend E. Aasland in :issue:`38371`.)
336359

360+
337361
Porting to Python 3.11
338362
======================
339363

@@ -476,19 +500,3 @@ Removed
476500
Use the new :c:type:`PyConfig` API of the :ref:`Python Initialization Configuration
477501
<init-config>` instead (:pep:`587`).
478502
(Contributed by Victor Stinner in :issue:`44113`.)
479-
480-
* The following deprecated functions and methods are removed in the :mod:`gettext`
481-
module: :func:`~gettext.lgettext`, :func:`~gettext.ldgettext`,
482-
:func:`~gettext.lngettext` and :func:`~gettext.ldngettext`.
483-
484-
Function :func:`~gettext.bind_textdomain_codeset`, methods
485-
:meth:`~gettext.NullTranslations.output_charset` and
486-
:meth:`~gettext.NullTranslations.set_output_charset`, and the *codeset*
487-
parameter of functions :func:`~gettext.translation` and
488-
:func:`~gettext.install` are also removed, since they are only used for
489-
the ``l*gettext()`` functions.
490-
(Contributed by Dong-hee Na and Serhiy Storchaka in :issue:`44235`.)
491-
492-
* The behavior of returning a value from a :class:`~unittest.TestCase` and
493-
:class:`~unittest.IsolatedAsyncioTestCase` test methods (other than the default ``None``
494-
value), is now deprecated.

0 commit comments

Comments
 (0)