Skip to content

Commit bb78f6c

Browse files
authored
Rebased version of what's new PR (#16745)
* Use Unicode character for accent * Various grammar fixes * Sort library modules alphabetically; remove duplicated idlelib/IDLE section
1 parent 466326d commit bb78f6c

File tree

1 file changed

+67
-83
lines changed

1 file changed

+67
-83
lines changed

Doc/whatsnew/3.8.rst

Lines changed: 67 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ Assignment expressions
8282
----------------------
8383

8484
There is new syntax ``:=`` that assigns values to variables as part of a larger
85-
expression. It is affectionately known as "walrus operator" due to
85+
expression. It is affectionately known as "the walrus operator" due to
8686
its resemblance to `the eyes and tusks of a walrus
8787
<https://en.wikipedia.org/wiki/Walrus#/media/File:Pacific_Walrus_-_Bull_(8247646168).jpg>`_.
8888

@@ -620,6 +620,16 @@ where the DLL is stored (if a full or partial path is used to load the initial
620620
DLL) and paths added by :func:`~os.add_dll_directory`.
621621

622622

623+
datetime
624+
--------
625+
626+
Added new alternate constructors :meth:`datetime.date.fromisocalendar` and
627+
:meth:`datetime.datetime.fromisocalendar`, which construct :class:`date` and
628+
:class:`datetime` objects respectively from ISO year, week number, and weekday;
629+
these are the inverse of each class's ``isocalendar`` method.
630+
(Contributed by Paul Ganssle in :issue:`36004`.)
631+
632+
623633
functools
624634
---------
625635

@@ -637,14 +647,12 @@ than as a function returning a decorator. So both of these are now supported::
637647
(Contributed by Raymond Hettinger in :issue:`36772`.)
638648

639649

640-
datetime
641-
--------
650+
gc
651+
--
642652

643-
Added new alternate constructors :meth:`datetime.date.fromisocalendar` and
644-
:meth:`datetime.datetime.fromisocalendar`, which construct :class:`date` and
645-
:class:`datetime` objects respectively from ISO year, week number and weekday;
646-
these are the inverse of each class's ``isocalendar`` method.
647-
(Contributed by Paul Ganssle in :issue:`36004`.)
653+
:func:`~gc.get_objects` can now receive an optional *generation* parameter
654+
indicating a generation to get objects from. Contributed in
655+
:issue:`36016` by Pablo Galindo.
648656

649657

650658
gettext
@@ -654,6 +662,18 @@ Added :func:`~gettext.pgettext` and its variants.
654662
(Contributed by Franz Glasner, Éric Araujo, and Cheryl Sabella in :issue:`2504`.)
655663

656664

665+
gzip
666+
----
667+
668+
Added the *mtime* parameter to :func:`gzip.compress` for reproducible output.
669+
(Contributed by Guo Ci Teo in :issue:`34898`.)
670+
671+
A :exc:`~gzip.BadGzipFile` exception is now raised instead of :exc:`OSError`
672+
for certain types of invalid or corrupt gzip files.
673+
(Contributed by Filip Gruszczyński, Michele Orrù, and Zackery Spytz in
674+
:issue:`6584`.)
675+
676+
657677
idlelib and IDLE
658678
----------------
659679

@@ -704,44 +724,6 @@ fails. The exception is ignored silently by default in release build.
704724
(Contributed by Victor Stinner in :issue:`18748`.)
705725

706726

707-
gc
708-
--
709-
710-
:func:`~gc.get_objects` can now receive an optional *generation* parameter
711-
indicating a generation to get objects from. Contributed in
712-
:issue:`36016` by Pablo Galindo.
713-
714-
715-
gzip
716-
----
717-
718-
Added the *mtime* parameter to :func:`gzip.compress` for reproducible output.
719-
(Contributed by Guo Ci Teo in :issue:`34898`.)
720-
721-
A :exc:`~gzip.BadGzipFile` exception is now raised instead of :exc:`OSError`
722-
for certain types of invalid or corrupt gzip files.
723-
(Contributed by Filip Gruszczyński, Michele Orrù, and Zackery Spytz in
724-
:issue:`6584`.)
725-
726-
727-
idlelib and IDLE
728-
----------------
729-
730-
Add optional line numbers for IDLE editor windows. Windows
731-
open without line numbers unless set otherwise in the General
732-
tab of the configuration dialog.
733-
(Contributed by Tal Einat and Saimadhav Heblikar in :issue:`17535`.)
734-
735-
Output over N lines (50 by default) is squeezed down to a button.
736-
N can be changed in the PyShell section of the General page of the
737-
Settings dialog. Fewer, but possibly extra long, lines can be squeezed by
738-
right clicking on the output. Squeezed output can be expanded in place
739-
by double-clicking the button or into the clipboard or a separate window
740-
by right-clicking the button. (Contributed by Tal Einat in :issue:`1529353`.)
741-
742-
The changes above have been backported to 3.7 maintenance releases.
743-
744-
745727
json.tool
746728
---------
747729

@@ -899,18 +881,6 @@ py_compile
899881
(Contributed by Joannah Nanjekye in :issue:`22640`.)
900882

901883

902-
socket
903-
------
904-
905-
Added :meth:`~socket.create_server()` and :meth:`~socket.has_dualstack_ipv6()`
906-
convenience functions to automate the necessary tasks usually involved when
907-
creating a server socket, including accepting both IPv4 and IPv6 connections
908-
on the same socket. (Contributed by Giampaolo Rodola in :issue:`17561`.)
909-
910-
The :func:`socket.if_nameindex()`, :func:`socket.if_nametoindex()`, and
911-
:func:`socket.if_indextoname()` functions have been implemented on Windows.
912-
(Contributed by Zackery Spytz in :issue:`37007`.)
913-
914884
shlex
915885
----------
916886

@@ -932,6 +902,19 @@ inherited from the corresponding change to the :mod:`tarfile` module.
932902
recursively removing their contents first.
933903

934904

905+
socket
906+
------
907+
908+
Added :meth:`~socket.create_server()` and :meth:`~socket.has_dualstack_ipv6()`
909+
convenience functions to automate the necessary tasks usually involved when
910+
creating a server socket, including accepting both IPv4 and IPv6 connections
911+
on the same socket. (Contributed by Giampaolo Rodolà in :issue:`17561`.)
912+
913+
The :func:`socket.if_nameindex()`, :func:`socket.if_nametoindex()`, and
914+
:func:`socket.if_indextoname()` functions have been implemented on Windows.
915+
(Contributed by Zackery Spytz in :issue:`37007`.)
916+
917+
935918
ssl
936919
---
937920

@@ -1202,14 +1185,14 @@ Optimizations
12021185
+26% on Linux, +50% on macOS and +40% on Windows. Also, much less CPU cycles
12031186
are consumed.
12041187
See :ref:`shutil-platform-dependent-efficient-copy-operations` section.
1205-
(Contributed by Giampaolo Rodola' in :issue:`33671`.)
1188+
(Contributed by Giampaolo Rodolà in :issue:`33671`.)
12061189

12071190
* :func:`shutil.copytree` uses :func:`os.scandir` function and all copy
12081191
functions depending from it use cached :func:`os.stat` values. The speedup
12091192
for copying a directory with 8000 files is around +9% on Linux, +20% on
12101193
Windows and +30% on a Windows SMB share. Also the number of :func:`os.stat`
12111194
syscalls is reduced by 38% making :func:`shutil.copytree` especially faster
1212-
on network filesystems. (Contributed by Giampaolo Rodola' in :issue:`33695`.)
1195+
on network filesystems. (Contributed by Giampaolo Rodolà in :issue:`33695`.)
12131196

12141197
* The default protocol in the :mod:`pickle` module is now Protocol 4,
12151198
first introduced in Python 3.4. It offers better performance and smaller
@@ -1361,7 +1344,7 @@ Deprecated
13611344
(Contributed by Victor Stinner in :issue:`37481`.)
13621345

13631346
* Deprecated methods ``getchildren()`` and ``getiterator()`` in
1364-
the :mod:`~xml.etree.ElementTree` module emit now a
1347+
the :mod:`~xml.etree.ElementTree` module now emit a
13651348
:exc:`DeprecationWarning` instead of :exc:`PendingDeprecationWarning`.
13661349
They will be removed in Python 3.9.
13671350
(Contributed by Serhiy Storchaka in :issue:`29209`.)
@@ -1454,28 +1437,29 @@ The following features and APIs have been removed from Python 3.8:
14541437
* The :mod:`macpath` module, deprecated in Python 3.7, has been removed.
14551438
(Contributed by Victor Stinner in :issue:`35471`.)
14561439

1457-
* The function :func:`platform.popen` has been removed, it was deprecated since
1458-
Python 3.3: use :func:`os.popen` instead.
1440+
* The function :func:`platform.popen` has been removed, after having been
1441+
deprecated since Python 3.3: use :func:`os.popen` instead.
14591442
(Contributed by Victor Stinner in :issue:`35345`.)
14601443

1461-
* The function :func:`time.clock` has been removed, it was deprecated since Python
1462-
3.3: use :func:`time.perf_counter` or :func:`time.process_time` instead, depending
1463-
on your requirements, to have a well defined behavior.
1444+
* The function :func:`time.clock` has been removed, after having been
1445+
deprecated since Python 3.3: use :func:`time.perf_counter` or
1446+
:func:`time.process_time` instead, depending
1447+
on your requirements, to have well-defined behavior.
14641448
(Contributed by Matthias Bussonnier in :issue:`36895`.)
14651449

14661450
* The ``pyvenv`` script has been removed in favor of ``python3.8 -m venv``
14671451
to help eliminate confusion as to what Python interpreter the ``pyvenv``
14681452
script is tied to. (Contributed by Brett Cannon in :issue:`25427`.)
14691453

1470-
* ``parse_qs``, ``parse_qsl``, and ``escape`` are removed from :mod:`cgi`
1471-
module. They are deprecated from Python 3.2 or older. They should be imported
1454+
* ``parse_qs``, ``parse_qsl``, and ``escape`` are removed from the :mod:`cgi`
1455+
module. They are deprecated in Python 3.2 or older. They should be imported
14721456
from the ``urllib.parse`` and ``html`` modules instead.
14731457

1474-
* ``filemode`` function is removed from :mod:`tarfile` module.
1458+
* ``filemode`` function is removed from the :mod:`tarfile` module.
14751459
It is not documented and deprecated since Python 3.3.
14761460

14771461
* The :class:`~xml.etree.ElementTree.XMLParser` constructor no longer accepts
1478-
the *html* argument. It never had effect and was deprecated in Python 3.4.
1462+
the *html* argument. It never had an effect and was deprecated in Python 3.4.
14791463
All other parameters are now :ref:`keyword-only <keyword-only_parameter>`.
14801464
(Contributed by Serhiy Storchaka in :issue:`29209`.)
14811465

@@ -1534,8 +1518,8 @@ Changes in Python behavior
15341518

15351519
* On AIX, :attr:`sys.platform` doesn't contain the major version anymore.
15361520
It is always ``'aix'``, instead of ``'aix3'`` .. ``'aix7'``. Since
1537-
older Python versions include the version number, it is recommended to
1538-
always use the ``sys.platform.startswith('aix')``.
1521+
older Python versions include the version number, so it is recommended to
1522+
always use ``sys.platform.startswith('aix')``.
15391523
(Contributed by M. Felt in :issue:`36588`.)
15401524

15411525
* :c:func:`PyEval_AcquireLock` and :c:func:`PyEval_AcquireThread` now
@@ -1555,8 +1539,8 @@ Changes in the Python API
15551539

15561540
* :class:`subprocess.Popen` can now use :func:`os.posix_spawn` in some cases
15571541
for better performance. On Windows Subsystem for Linux and QEMU User
1558-
Emulation, Popen constructor using :func:`os.posix_spawn` no longer raise an
1559-
exception on errors like missing program, but the child process fails with a
1542+
Emulation, the :class:`Popen` constructor using :func:`os.posix_spawn` no longer raises an
1543+
exception on errors like "missing program". Instead the child process fails with a
15601544
non-zero :attr:`~Popen.returncode`.
15611545
(Contributed by Joannah Nanjekye and Victor Stinner in :issue:`35537`.)
15621546

@@ -1569,7 +1553,7 @@ Changes in the Python API
15691553
* The :meth:`imap.IMAP4.logout` method no longer ignores silently arbitrary
15701554
exceptions.
15711555

1572-
* The function :func:`platform.popen` has been removed, it was deprecated since
1556+
* The function :func:`platform.popen` has been removed, after having been deprecated since
15731557
Python 3.3: use :func:`os.popen` instead.
15741558
(Contributed by Victor Stinner in :issue:`35345`.)
15751559

@@ -1584,9 +1568,9 @@ Changes in the Python API
15841568
specialized methods like :meth:`~tkinter.ttk.Treeview.selection_set` for
15851569
changing the selection. (Contributed by Serhiy Storchaka in :issue:`31508`.)
15861570

1587-
* The :meth:`writexml`, :meth:`toxml` and :meth:`toprettyxml` methods of the
1588-
:mod:`xml.dom.minidom` module, and :mod:`xml.etree` now preserve the attribute
1589-
order specified by the user.
1571+
* The :meth:`writexml`, :meth:`toxml` and :meth:`toprettyxml` methods of
1572+
:mod:`xml.dom.minidom`, and the :meth:`write` method of :mod:`xml.etree`,
1573+
now preserve the attribute order specified by the user.
15901574
(Contributed by Diego Rojas and Raymond Hettinger in :issue:`34160`.)
15911575

15921576
* A :mod:`dbm.dumb` database opened with flags ``'r'`` is now read-only.
@@ -1596,7 +1580,7 @@ Changes in the Python API
15961580

15971581
* The ``doctype()`` method defined in a subclass of
15981582
:class:`~xml.etree.ElementTree.XMLParser` will no longer be called and will
1599-
cause emitting a :exc:`RuntimeWarning` instead of a :exc:`DeprecationWarning`.
1583+
emit a :exc:`RuntimeWarning` instead of a :exc:`DeprecationWarning`.
16001584
Define the :meth:`doctype() <xml.etree.ElementTree.TreeBuilder.doctype>`
16011585
method on a target for handling an XML doctype declaration.
16021586
(Contributed by Serhiy Storchaka in :issue:`29209`.)
@@ -1639,7 +1623,7 @@ Changes in the Python API
16391623

16401624
* The :meth:`mmap.flush() <mmap.mmap.flush>` method now returns ``None`` on
16411625
success and raises an exception on error under all platforms. Previously,
1642-
its behavior was platform-depended: a nonzero value was returned on success;
1626+
its behavior was platform-dependent: a nonzero value was returned on success;
16431627
zero was returned on error under Windows. A zero value was returned on
16441628
success; an exception was raised on error under Unix.
16451629
(Contributed by Berker Peksag in :issue:`2122`.)
@@ -1683,17 +1667,17 @@ Changes in the Python API
16831667
* :class:`types.CodeType` has a new parameter in the second position of the
16841668
constructor (*posonlyargcount*) to support positional-only arguments defined
16851669
in :pep:`570`. The first argument (*argcount*) now represents the total
1686-
number of positional arguments (including positional-only arguments). A new
1670+
number of positional arguments (including positional-only arguments). The new
16871671
``replace()`` method of :class:`types.CodeType` can be used to make the code
16881672
future-proof.
16891673

16901674

16911675
Changes in the C API
16921676
--------------------
16931677

1694-
* The :c:type:`PyCompilerFlags` structure gets a new *cf_feature_version*
1678+
* The :c:type:`PyCompilerFlags` structure got a new *cf_feature_version*
16951679
field. It should be initialized to ``PY_MINOR_VERSION``. The field is ignored
1696-
by default, it is used if and only if ``PyCF_ONLY_AST`` flag is set in
1680+
by default, and is used if and only if ``PyCF_ONLY_AST`` flag is set in
16971681
*cf_flags*.
16981682

16991683
* The :c:func:`PyEval_ReInitThreads` function has been removed from the C API.

0 commit comments

Comments
 (0)