@@ -82,7 +82,7 @@ Assignment expressions
82
82
----------------------
83
83
84
84
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
86
86
its resemblance to `the eyes and tusks of a walrus
87
87
<https://en.wikipedia.org/wiki/Walrus#/media/File:Pacific_Walrus_-_Bull_(8247646168).jpg> `_.
88
88
@@ -620,6 +620,16 @@ where the DLL is stored (if a full or partial path is used to load the initial
620
620
DLL) and paths added by :func: `~os.add_dll_directory `.
621
621
622
622
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
+
623
633
functools
624
634
---------
625
635
@@ -637,14 +647,12 @@ than as a function returning a decorator. So both of these are now supported::
637
647
(Contributed by Raymond Hettinger in :issue: `36772 `.)
638
648
639
649
640
- datetime
641
- --------
650
+ gc
651
+ --
642
652
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.
648
656
649
657
650
658
gettext
@@ -654,6 +662,18 @@ Added :func:`~gettext.pgettext` and its variants.
654
662
(Contributed by Franz Glasner, Éric Araujo, and Cheryl Sabella in :issue: `2504 `.)
655
663
656
664
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
+
657
677
idlelib and IDLE
658
678
----------------
659
679
@@ -704,44 +724,6 @@ fails. The exception is ignored silently by default in release build.
704
724
(Contributed by Victor Stinner in :issue: `18748 `.)
705
725
706
726
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
-
745
727
json.tool
746
728
---------
747
729
@@ -899,18 +881,6 @@ py_compile
899
881
(Contributed by Joannah Nanjekye in :issue: `22640 `.)
900
882
901
883
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
-
914
884
shlex
915
885
----------
916
886
@@ -932,6 +902,19 @@ inherited from the corresponding change to the :mod:`tarfile` module.
932
902
recursively removing their contents first.
933
903
934
904
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
+
935
918
ssl
936
919
---
937
920
@@ -1202,14 +1185,14 @@ Optimizations
1202
1185
+26% on Linux, +50% on macOS and +40% on Windows. Also, much less CPU cycles
1203
1186
are consumed.
1204
1187
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 `.)
1206
1189
1207
1190
* :func: `shutil.copytree ` uses :func: `os.scandir ` function and all copy
1208
1191
functions depending from it use cached :func: `os.stat ` values. The speedup
1209
1192
for copying a directory with 8000 files is around +9% on Linux, +20% on
1210
1193
Windows and +30% on a Windows SMB share. Also the number of :func: `os.stat `
1211
1194
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 `.)
1213
1196
1214
1197
* The default protocol in the :mod: `pickle ` module is now Protocol 4,
1215
1198
first introduced in Python 3.4. It offers better performance and smaller
@@ -1361,7 +1344,7 @@ Deprecated
1361
1344
(Contributed by Victor Stinner in :issue: `37481 `.)
1362
1345
1363
1346
* 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
1365
1348
:exc: `DeprecationWarning ` instead of :exc: `PendingDeprecationWarning `.
1366
1349
They will be removed in Python 3.9.
1367
1350
(Contributed by Serhiy Storchaka in :issue: `29209 `.)
@@ -1456,28 +1439,29 @@ The following features and APIs have been removed from Python 3.8:
1456
1439
* The :mod: `macpath ` module, deprecated in Python 3.7, has been removed.
1457
1440
(Contributed by Victor Stinner in :issue: `35471 `.)
1458
1441
1459
- * The function :func: `platform.popen ` has been removed, it was deprecated since
1460
- Python 3.3: use :func: `os.popen ` instead.
1442
+ * The function :func: `platform.popen ` has been removed, after having been
1443
+ deprecated since Python 3.3: use :func: `os.popen ` instead.
1461
1444
(Contributed by Victor Stinner in :issue: `35345 `.)
1462
1445
1463
- * The function :func: `time.clock ` has been removed, it was deprecated since Python
1464
- 3.3: use :func: `time.perf_counter ` or :func: `time.process_time ` instead, depending
1465
- on your requirements, to have a well defined behavior.
1446
+ * The function :func: `time.clock ` has been removed, after having been
1447
+ deprecated since Python 3.3: use :func: `time.perf_counter ` or
1448
+ :func: `time.process_time ` instead, depending
1449
+ on your requirements, to have well-defined behavior.
1466
1450
(Contributed by Matthias Bussonnier in :issue: `36895 `.)
1467
1451
1468
1452
* The ``pyvenv `` script has been removed in favor of ``python3.8 -m venv ``
1469
1453
to help eliminate confusion as to what Python interpreter the ``pyvenv ``
1470
1454
script is tied to. (Contributed by Brett Cannon in :issue: `25427 `.)
1471
1455
1472
- * ``parse_qs ``, ``parse_qsl ``, and ``escape `` are removed from :mod: `cgi `
1473
- module. They are deprecated from Python 3.2 or older. They should be imported
1456
+ * ``parse_qs ``, ``parse_qsl ``, and ``escape `` are removed from the :mod: `cgi `
1457
+ module. They are deprecated in Python 3.2 or older. They should be imported
1474
1458
from the ``urllib.parse `` and ``html `` modules instead.
1475
1459
1476
- * ``filemode `` function is removed from :mod: `tarfile ` module.
1460
+ * ``filemode `` function is removed from the :mod: `tarfile ` module.
1477
1461
It is not documented and deprecated since Python 3.3.
1478
1462
1479
1463
* The :class: `~xml.etree.ElementTree.XMLParser ` constructor no longer accepts
1480
- the *html * argument. It never had effect and was deprecated in Python 3.4.
1464
+ the *html * argument. It never had an effect and was deprecated in Python 3.4.
1481
1465
All other parameters are now :ref: `keyword-only <keyword-only_parameter >`.
1482
1466
(Contributed by Serhiy Storchaka in :issue: `29209 `.)
1483
1467
@@ -1536,8 +1520,8 @@ Changes in Python behavior
1536
1520
1537
1521
* On AIX, :attr: `sys.platform ` doesn't contain the major version anymore.
1538
1522
It is always ``'aix' ``, instead of ``'aix3' `` .. ``'aix7' ``. Since
1539
- older Python versions include the version number, it is recommended to
1540
- always use the ``sys.platform.startswith('aix') ``.
1523
+ older Python versions include the version number, so it is recommended to
1524
+ always use ``sys.platform.startswith('aix') ``.
1541
1525
(Contributed by M. Felt in :issue: `36588 `.)
1542
1526
1543
1527
* :c:func: `PyEval_AcquireLock ` and :c:func: `PyEval_AcquireThread ` now
@@ -1557,8 +1541,8 @@ Changes in the Python API
1557
1541
1558
1542
* :class: `subprocess.Popen ` can now use :func: `os.posix_spawn ` in some cases
1559
1543
for better performance. On Windows Subsystem for Linux and QEMU User
1560
- Emulation, Popen constructor using :func: `os.posix_spawn ` no longer raise an
1561
- exception on errors like missing program, but the child process fails with a
1544
+ Emulation, the :class: ` Popen ` constructor using :func: `os.posix_spawn ` no longer raises an
1545
+ exception on errors like " missing program". Instead the child process fails with a
1562
1546
non-zero :attr: `~Popen.returncode `.
1563
1547
(Contributed by Joannah Nanjekye and Victor Stinner in :issue: `35537 `.)
1564
1548
@@ -1571,7 +1555,7 @@ Changes in the Python API
1571
1555
* The :meth: `imap.IMAP4.logout ` method no longer ignores silently arbitrary
1572
1556
exceptions.
1573
1557
1574
- * The function :func: `platform.popen ` has been removed, it was deprecated since
1558
+ * The function :func: `platform.popen ` has been removed, after having been deprecated since
1575
1559
Python 3.3: use :func: `os.popen ` instead.
1576
1560
(Contributed by Victor Stinner in :issue: `35345 `.)
1577
1561
@@ -1586,9 +1570,9 @@ Changes in the Python API
1586
1570
specialized methods like :meth: `~tkinter.ttk.Treeview.selection_set ` for
1587
1571
changing the selection. (Contributed by Serhiy Storchaka in :issue: `31508 `.)
1588
1572
1589
- * The :meth: `writexml `, :meth: `toxml ` and :meth: `toprettyxml ` methods of the
1590
- :mod: `xml.dom.minidom ` module , and : mod: `xml.etree ` now preserve the attribute
1591
- order specified by the user.
1573
+ * The :meth: `writexml `, :meth: `toxml ` and :meth: `toprettyxml ` methods of
1574
+ :mod: `xml.dom.minidom `, and the :meth: ` write ` method of : mod: `xml.etree `,
1575
+ now preserve the attribute order specified by the user.
1592
1576
(Contributed by Diego Rojas and Raymond Hettinger in :issue: `34160 `.)
1593
1577
1594
1578
* A :mod: `dbm.dumb ` database opened with flags ``'r' `` is now read-only.
@@ -1598,7 +1582,7 @@ Changes in the Python API
1598
1582
1599
1583
* The ``doctype() `` method defined in a subclass of
1600
1584
:class: `~xml.etree.ElementTree.XMLParser ` will no longer be called and will
1601
- cause emitting a :exc: `RuntimeWarning ` instead of a :exc: `DeprecationWarning `.
1585
+ emit a :exc: `RuntimeWarning ` instead of a :exc: `DeprecationWarning `.
1602
1586
Define the :meth: `doctype() <xml.etree.ElementTree.TreeBuilder.doctype> `
1603
1587
method on a target for handling an XML doctype declaration.
1604
1588
(Contributed by Serhiy Storchaka in :issue: `29209 `.)
@@ -1641,7 +1625,7 @@ Changes in the Python API
1641
1625
1642
1626
* The :meth: `mmap.flush() <mmap.mmap.flush> ` method now returns ``None `` on
1643
1627
success and raises an exception on error under all platforms. Previously,
1644
- its behavior was platform-depended : a nonzero value was returned on success;
1628
+ its behavior was platform-dependent : a nonzero value was returned on success;
1645
1629
zero was returned on error under Windows. A zero value was returned on
1646
1630
success; an exception was raised on error under Unix.
1647
1631
(Contributed by Berker Peksag in :issue: `2122 `.)
@@ -1685,17 +1669,17 @@ Changes in the Python API
1685
1669
* :class: `types.CodeType ` has a new parameter in the second position of the
1686
1670
constructor (*posonlyargcount *) to support positional-only arguments defined
1687
1671
in :pep: `570 `. The first argument (*argcount *) now represents the total
1688
- number of positional arguments (including positional-only arguments). A new
1672
+ number of positional arguments (including positional-only arguments). The new
1689
1673
``replace() `` method of :class: `types.CodeType ` can be used to make the code
1690
1674
future-proof.
1691
1675
1692
1676
1693
1677
Changes in the C API
1694
1678
--------------------
1695
1679
1696
- * The :c:type: `PyCompilerFlags ` structure gets a new *cf_feature_version *
1680
+ * The :c:type: `PyCompilerFlags ` structure got a new *cf_feature_version *
1697
1681
field. It should be initialized to ``PY_MINOR_VERSION ``. The field is ignored
1698
- by default, it is used if and only if ``PyCF_ONLY_AST `` flag is set in
1682
+ by default, and is used if and only if ``PyCF_ONLY_AST `` flag is set in
1699
1683
*cf_flags *.
1700
1684
1701
1685
* The :c:func: `PyEval_ReInitThreads ` function has been removed from the C API.
0 commit comments