[Python-checkins] bpo-32996: Enhancements to What's New based on feedback (GH-7988)

Miss Islington (bot) webhook-mailer at python.org
Thu Jun 28 12:14:55 EDT 2018


https://github.com/python/cpython/commit/48dc7527e32512a27a58107477926719ea4c589b
commit: 48dc7527e32512a27a58107477926719ea4c589b
branch: 3.7
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2018-06-28T09:14:52-07:00
summary:

bpo-32996: Enhancements to What's New based on feedback (GH-7988)

(cherry picked from commit 4d26c8a177d8ada440b3cfdfb1d0423ab5ca81a7)

Co-authored-by: Elvis Pranskevichus <elvis at magic.io>

files:
M Doc/whatsnew/3.7.rst

diff --git a/Doc/whatsnew/3.7.rst b/Doc/whatsnew/3.7.rst
index a04b15ccecf8..53fbe185a3ad 100644
--- a/Doc/whatsnew/3.7.rst
+++ b/Doc/whatsnew/3.7.rst
@@ -320,7 +320,8 @@ PEP 562: Customization of Access to Module Attributes
 -----------------------------------------------------
 
 Python 3.7 allows defining :meth:`__getattr__` on modules and will call
-it whenever a module attribute is otherwise not found.
+it whenever a module attribute is otherwise not found.  Defining
+:meth:`__dir__` on modules is now also allowed.
 
 A typical example of where this may be useful is module attribute deprecation
 and lazy loading.
@@ -336,8 +337,11 @@ and lazy loading.
 PEP 564: New Time Functions With Nanosecond Resolution
 ------------------------------------------------------
 
-:pep:`564` adds six new "nanosecond" variants of existing functions
-to the :mod:`time` module:
+The resolution of clocks in modern systems can exceed the limited precision
+of a floating point number returned by the :func:`time.time` function
+and its variants.  To avoid loss of precision, :pep:`564` adds six new
+"nanosecond" variants of the existing timer functions to the :mod:`time`
+module:
 
 * :func:`time.clock_gettime_ns`
 * :func:`time.clock_settime_ns`
@@ -346,12 +350,11 @@ to the :mod:`time` module:
 * :func:`time.process_time_ns`
 * :func:`time.time_ns`
 
-The new functions are similar in function to the existing functions
-without the ``_ns`` suffix.  They differ by returning nanoseconds as
-integers instead of fractional seconds.
+The new functions return the number of nanoseconds as an integer value.
 
-On Linux and Windows the resolution of :func:`time.time_ns` is 3 times
-better than that of :func:`time.time`.
+`Measurements <https://www.python.org/dev/peps/pep-0564/#annex-clocks-resolution-in-python>`_
+show that on Linux and Windows the resolution of :func:`time.time_ns` is
+approximately 3 times better than that of :func:`time.time`.
 
 .. seealso::
 
@@ -418,19 +421,6 @@ fixed.
       PEP written and implemented by Ivan Levkivskyi
 
 
-.. _whatsnew37-devmode:
-
-Development Runtime Mode: -X dev
---------------------------------
-
-The new :option:`-X` ``dev`` command line option or the new
-:envvar:`PYTHONDEVMODE` environment variable can be used to enable
-CPython's *development mode*.  When in development mode, CPython performs
-additional runtime checks which are too expensive to be enabled by default.
-See :option:`-X` ``dev`` documentation for the full description of the effects
-of this mode.
-
-
 .. _whatsnew37-pep552:
 
 PEP 552: Hash-based .pyc Files
@@ -460,6 +450,11 @@ keeping ``.pyc`` files up-to-date.
 
 See :ref:`pyc-invalidation` for more information.
 
+.. seealso::
+
+   :pep:`552` -- Deterministic pycs
+      PEP written and implemented by Benjamin Peterson
+
 
 .. _whatsnew37-pep545:
 
@@ -482,6 +477,19 @@ Three new translations have been added:
       Victor Stinner.
 
 
+.. _whatsnew37-devmode:
+
+Development Runtime Mode: -X dev
+--------------------------------
+
+The new :option:`-X` ``dev`` command line option or the new
+:envvar:`PYTHONDEVMODE` environment variable can be used to enable
+CPython's *development mode*.  When in development mode, CPython performs
+additional runtime checks that are too expensive to be enabled by default.
+See :option:`-X` ``dev`` documentation for the full description of the effects
+of this mode.
+
+
 Other Language Changes
 ======================
 



More information about the Python-checkins mailing list