Kaydet (Commit) 4d26c8a1 authored tarafından Elvis Pranskevichus's avatar Elvis Pranskevichus Kaydeden (comit) Yury Selivanov

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

üst e76ac9d4
...@@ -320,7 +320,8 @@ PEP 562: Customization of Access to Module Attributes ...@@ -320,7 +320,8 @@ PEP 562: Customization of Access to Module Attributes
----------------------------------------------------- -----------------------------------------------------
Python 3.7 allows defining :meth:`__getattr__` on modules and will call 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 A typical example of where this may be useful is module attribute deprecation
and lazy loading. and lazy loading.
...@@ -336,8 +337,11 @@ and lazy loading. ...@@ -336,8 +337,11 @@ and lazy loading.
PEP 564: New Time Functions With Nanosecond Resolution PEP 564: New Time Functions With Nanosecond Resolution
------------------------------------------------------ ------------------------------------------------------
:pep:`564` adds six new "nanosecond" variants of existing functions The resolution of clocks in modern systems can exceed the limited precision
to the :mod:`time` module: 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_gettime_ns`
* :func:`time.clock_settime_ns` * :func:`time.clock_settime_ns`
...@@ -346,12 +350,11 @@ to the :mod:`time` module: ...@@ -346,12 +350,11 @@ to the :mod:`time` module:
* :func:`time.process_time_ns` * :func:`time.process_time_ns`
* :func:`time.time_ns` * :func:`time.time_ns`
The new functions are similar in function to the existing functions The new functions return the number of nanoseconds as an integer value.
without the ``_ns`` suffix. They differ by returning nanoseconds as
integers instead of fractional seconds.
On Linux and Windows the resolution of :func:`time.time_ns` is 3 times `Measurements <https://www.python.org/dev/peps/pep-0564/#annex-clocks-resolution-in-python>`_
better than that of :func:`time.time`. 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:: .. seealso::
...@@ -418,19 +421,6 @@ fixed. ...@@ -418,19 +421,6 @@ fixed.
PEP written and implemented by Ivan Levkivskyi 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: .. _whatsnew37-pep552:
PEP 552: Hash-based .pyc Files PEP 552: Hash-based .pyc Files
...@@ -460,6 +450,11 @@ keeping ``.pyc`` files up-to-date. ...@@ -460,6 +450,11 @@ keeping ``.pyc`` files up-to-date.
See :ref:`pyc-invalidation` for more information. See :ref:`pyc-invalidation` for more information.
.. seealso::
:pep:`552` -- Deterministic pycs
PEP written and implemented by Benjamin Peterson
.. _whatsnew37-pep545: .. _whatsnew37-pep545:
...@@ -482,6 +477,19 @@ Three new translations have been added: ...@@ -482,6 +477,19 @@ Three new translations have been added:
Victor Stinner. 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 Other Language Changes
====================== ======================
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment