@@ -320,7 +320,8 @@ PEP 562: Customization of Access to Module Attributes
320320-----------------------------------------------------
321321
322322Python 3.7 allows defining :meth: `__getattr__ ` on modules and will call
323- it whenever a module attribute is otherwise not found.
323+ it whenever a module attribute is otherwise not found. Defining
324+ :meth: `__dir__ ` on modules is now also allowed.
324325
325326A typical example of where this may be useful is module attribute deprecation
326327and lazy loading.
@@ -336,8 +337,11 @@ and lazy loading.
336337PEP 564: New Time Functions With Nanosecond Resolution
337338------------------------------------------------------
338339
339- :pep: `564 ` adds six new "nanosecond" variants of existing functions
340- to the :mod: `time ` module:
340+ The resolution of clocks in modern systems can exceed the limited precision
341+ of a floating point number returned by the :func: `time.time ` function
342+ and its variants. To avoid loss of precision, :pep: `564 ` adds six new
343+ "nanosecond" variants of the existing timer functions to the :mod: `time `
344+ module:
341345
342346* :func: `time.clock_gettime_ns `
343347* :func: `time.clock_settime_ns `
@@ -346,12 +350,11 @@ to the :mod:`time` module:
346350* :func: `time.process_time_ns `
347351* :func: `time.time_ns `
348352
349- The new functions are similar in function to the existing functions
350- without the ``_ns `` suffix. They differ by returning nanoseconds as
351- integers instead of fractional seconds.
353+ The new functions return the number of nanoseconds as an integer value.
352354
353- On Linux and Windows the resolution of :func: `time.time_ns ` is 3 times
354- better than that of :func: `time.time `.
355+ `Measurements <https://www.python.org/dev/peps/pep-0564/#annex-clocks-resolution-in-python >`_
356+ show that on Linux and Windows the resolution of :func: `time.time_ns ` is
357+ approximately 3 times better than that of :func: `time.time `.
355358
356359.. seealso ::
357360
@@ -418,19 +421,6 @@ fixed.
418421 PEP written and implemented by Ivan Levkivskyi
419422
420423
421- .. _whatsnew37-devmode :
422-
423- Development Runtime Mode: -X dev
424- --------------------------------
425-
426- The new :option: `-X ` ``dev `` command line option or the new
427- :envvar: `PYTHONDEVMODE ` environment variable can be used to enable
428- CPython's *development mode *. When in development mode, CPython performs
429- additional runtime checks which are too expensive to be enabled by default.
430- See :option: `-X ` ``dev `` documentation for the full description of the effects
431- of this mode.
432-
433-
434424.. _whatsnew37-pep552 :
435425
436426PEP 552: Hash-based .pyc Files
@@ -460,6 +450,11 @@ keeping ``.pyc`` files up-to-date.
460450
461451See :ref: `pyc-invalidation ` for more information.
462452
453+ .. seealso ::
454+
455+ :pep: `552 ` -- Deterministic pycs
456+ PEP written and implemented by Benjamin Peterson
457+
463458
464459.. _whatsnew37-pep545 :
465460
@@ -482,6 +477,19 @@ Three new translations have been added:
482477 Victor Stinner.
483478
484479
480+ .. _whatsnew37-devmode :
481+
482+ Development Runtime Mode: -X dev
483+ --------------------------------
484+
485+ The new :option: `-X ` ``dev `` command line option or the new
486+ :envvar: `PYTHONDEVMODE ` environment variable can be used to enable
487+ CPython's *development mode *. When in development mode, CPython performs
488+ additional runtime checks that are too expensive to be enabled by default.
489+ See :option: `-X ` ``dev `` documentation for the full description of the effects
490+ of this mode.
491+
492+
485493Other Language Changes
486494======================
487495
0 commit comments