@@ -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 `.)
@@ -1454,28 +1437,29 @@ The following features and APIs have been removed from Python 3.8:
1454
1437
* The :mod: `macpath ` module, deprecated in Python 3.7, has been removed.
1455
1438
(Contributed by Victor Stinner in :issue: `35471 `.)
1456
1439
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.
1459
1442
(Contributed by Victor Stinner in :issue: `35345 `.)
1460
1443
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.
1464
1448
(Contributed by Matthias Bussonnier in :issue: `36895 `.)
1465
1449
1466
1450
* The ``pyvenv `` script has been removed in favor of ``python3.8 -m venv ``
1467
1451
to help eliminate confusion as to what Python interpreter the ``pyvenv ``
1468
1452
script is tied to. (Contributed by Brett Cannon in :issue: `25427 `.)
1469
1453
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
1472
1456
from the ``urllib.parse `` and ``html `` modules instead.
1473
1457
1474
- * ``filemode `` function is removed from :mod: `tarfile ` module.
1458
+ * ``filemode `` function is removed from the :mod: `tarfile ` module.
1475
1459
It is not documented and deprecated since Python 3.3.
1476
1460
1477
1461
* 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.
1479
1463
All other parameters are now :ref: `keyword-only <keyword-only_parameter >`.
1480
1464
(Contributed by Serhiy Storchaka in :issue: `29209 `.)
1481
1465
@@ -1534,8 +1518,8 @@ Changes in Python behavior
1534
1518
1535
1519
* On AIX, :attr: `sys.platform ` doesn't contain the major version anymore.
1536
1520
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') ``.
1539
1523
(Contributed by M. Felt in :issue: `36588 `.)
1540
1524
1541
1525
* :c:func: `PyEval_AcquireLock ` and :c:func: `PyEval_AcquireThread ` now
@@ -1555,8 +1539,8 @@ Changes in the Python API
1555
1539
1556
1540
* :class: `subprocess.Popen ` can now use :func: `os.posix_spawn ` in some cases
1557
1541
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
1560
1544
non-zero :attr: `~Popen.returncode `.
1561
1545
(Contributed by Joannah Nanjekye and Victor Stinner in :issue: `35537 `.)
1562
1546
@@ -1569,7 +1553,7 @@ Changes in the Python API
1569
1553
* The :meth: `imap.IMAP4.logout ` method no longer ignores silently arbitrary
1570
1554
exceptions.
1571
1555
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
1573
1557
Python 3.3: use :func: `os.popen ` instead.
1574
1558
(Contributed by Victor Stinner in :issue: `35345 `.)
1575
1559
@@ -1584,9 +1568,9 @@ Changes in the Python API
1584
1568
specialized methods like :meth: `~tkinter.ttk.Treeview.selection_set ` for
1585
1569
changing the selection. (Contributed by Serhiy Storchaka in :issue: `31508 `.)
1586
1570
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.
1590
1574
(Contributed by Diego Rojas and Raymond Hettinger in :issue: `34160 `.)
1591
1575
1592
1576
* A :mod: `dbm.dumb ` database opened with flags ``'r' `` is now read-only.
@@ -1596,7 +1580,7 @@ Changes in the Python API
1596
1580
1597
1581
* The ``doctype() `` method defined in a subclass of
1598
1582
: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 `.
1600
1584
Define the :meth: `doctype() <xml.etree.ElementTree.TreeBuilder.doctype> `
1601
1585
method on a target for handling an XML doctype declaration.
1602
1586
(Contributed by Serhiy Storchaka in :issue: `29209 `.)
@@ -1639,7 +1623,7 @@ Changes in the Python API
1639
1623
1640
1624
* The :meth: `mmap.flush() <mmap.mmap.flush> ` method now returns ``None `` on
1641
1625
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;
1643
1627
zero was returned on error under Windows. A zero value was returned on
1644
1628
success; an exception was raised on error under Unix.
1645
1629
(Contributed by Berker Peksag in :issue: `2122 `.)
@@ -1683,17 +1667,17 @@ Changes in the Python API
1683
1667
* :class: `types.CodeType ` has a new parameter in the second position of the
1684
1668
constructor (*posonlyargcount *) to support positional-only arguments defined
1685
1669
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
1687
1671
``replace() `` method of :class: `types.CodeType ` can be used to make the code
1688
1672
future-proof.
1689
1673
1690
1674
1691
1675
Changes in the C API
1692
1676
--------------------
1693
1677
1694
- * The :c:type: `PyCompilerFlags ` structure gets a new *cf_feature_version *
1678
+ * The :c:type: `PyCompilerFlags ` structure got a new *cf_feature_version *
1695
1679
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
1697
1681
*cf_flags *.
1698
1682
1699
1683
* The :c:func: `PyEval_ReInitThreads ` function has been removed from the C API.
0 commit comments