Thanks to visit codestin.com
Credit goes to github.com

Skip to content

gh-123299: Copy-edit the 3.14 What's New #124670

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Doc/deprecations/pending-removal-in-3.16.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ Pending Removal in Python 3.16
Use the ``'w'`` format code (:c:type:`Py_UCS4`)
for Unicode characters instead.

* :mod:`asyncio`:

* :mod:`asyncio`:
:func:`!asyncio.iscoroutinefunction` is deprecated
and will be removed in Python 3.16,
use :func:`inspect.iscoroutinefunction` instead.
(Contributed by Jiahao Li and Kumar Aditya in :gh:`122875`.)

* :mod:`shutil`:

* The :class:`!ExecError` exception
Expand Down
93 changes: 48 additions & 45 deletions Doc/whatsnew/3.14.rst
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ Other Language Changes
``python -O -c 'assert (__debug__ := 1)'`` now produces a
:exc:`SyntaxError`. (Contributed by Irit Katriel in :gh:`122245`.)

* Added class methods :meth:`float.from_number` and :meth:`complex.from_number`
* Add class methods :meth:`float.from_number` and :meth:`complex.from_number`
to convert a number to :class:`float` or :class:`complex` type correspondingly.
They raise an error if the argument is a string.
(Contributed by Serhiy Storchaka in :gh:`84978`.)
Expand All @@ -206,7 +206,7 @@ Improved Modules
ast
---

* Added :func:`ast.compare` for comparing two ASTs.
* Add :func:`ast.compare` for comparing two ASTs.
(Contributed by Batuhan Taskaya and Jeremy Hylton in :issue:`15987`.)

* Add support for :func:`copy.replace` for AST nodes.
Expand All @@ -215,6 +215,9 @@ ast
* Docstrings are now removed from an optimized AST in optimization level 2.
(Contributed by Irit Katriel in :gh:`123958`.)

* The ``repr()`` output for AST nodes now includes more information.
(Contributed by Tomas R in :gh:`116022`.)


ctypes
------
Expand All @@ -233,32 +236,31 @@ ctypes
dis
---

* Added support for rendering full source location information of
* Add support for rendering full source location information of
:class:`instructions <dis.Instruction>`, rather than only the line number.
This feature is added to the following interfaces via the ``show_positions``
This feature is added to the following interfaces via the *show_positions*
keyword argument:

- :class:`dis.Bytecode`,
- :func:`dis.dis`, :func:`dis.distb`, and
- :func:`dis.disassemble`.

This feature is also exposed via :option:`dis --show-positions`.

(Contributed by BΓ©nΓ©dikt Tran in :gh:`123165`.)


fractions
---------

Added support for converting any objects that have the
:meth:`!as_integer_ratio` method to a :class:`~fractions.Fraction`.
(Contributed by Serhiy Storchaka in :gh:`82017`.)
* Add support for converting any objects that have the
:meth:`!as_integer_ratio` method to a :class:`~fractions.Fraction`.
(Contributed by Serhiy Storchaka in :gh:`82017`.)


functools
---------

* Added support to :func:`functools.partial` and
* Add support to :func:`functools.partial` and
:func:`functools.partialmethod` for :data:`functools.Placeholder` sentinels
to reserve a place for positional arguments.
(Contributed by Dominykas Grigonis in :gh:`119127`.)
Expand All @@ -267,27 +269,27 @@ functools
http
----

Directory lists and error pages generated by the :mod:`http.server`
module allow the browser to apply its default dark mode.
(Contributed by Yorik Hansen in :gh:`123430`.)
* Directory lists and error pages generated by the :mod:`http.server`
module allow the browser to apply its default dark mode.
(Contributed by Yorik Hansen in :gh:`123430`.)


json
----

Add notes for JSON serialization errors that allow to identify the source
of the error.
(Contributed by Serhiy Storchaka in :gh:`122163`.)
* Add notes for JSON serialization errors that allow to identify the source
of the error.
(Contributed by Serhiy Storchaka in :gh:`122163`.)

Enable :mod:`json` module to work as a script using the :option:`-m` switch: ``python -m json``.
See the :ref:`JSON command-line interface <json-commandline>` documentation.
(Contributed by Trey Hunner in :gh:`122873`.)
* Enable the :mod:`json` module to work as a script using the :option:`-m` switch: ``python -m json``.
See the :ref:`JSON command-line interface <json-commandline>` documentation.
(Contributed by Trey Hunner in :gh:`122873`.)


operator
--------

* Two new functions ``operator.is_none`` and ``operator.is_not_none``
* Two new functions :func:`operator.is_none` and :func:`operator.is_not_none`
have been added, such that ``operator.is_none(obj)`` is equivalent
to ``obj is None`` and ``operator.is_not_none(obj)`` is equivalent
to ``obj is not None``.
Expand All @@ -297,13 +299,13 @@ operator
datetime
--------

Add :meth:`datetime.time.strptime` and :meth:`datetime.date.strptime`.
(Contributed by Wannes Boeykens in :gh:`41431`.)
* Add :meth:`datetime.time.strptime` and :meth:`datetime.date.strptime`.
(Contributed by Wannes Boeykens in :gh:`41431`.)

os
--

* Added the :data:`os.environ.refresh() <os.environ>` method to update
* Add the :data:`os.environ.refresh() <os.environ>` method to update
:data:`os.environ` with changes to the environment made by :func:`os.putenv`,
by :func:`os.unsetenv`, or made outside Python in the same process.
(Contributed by Victor Stinner in :gh:`120057`.)
Expand Down Expand Up @@ -333,15 +335,15 @@ pdb
:pdbcmd:`commands` are preserved across hard-coded breakpoints.
(Contributed by Tian Gao in :gh:`121450`.)

* Added a new argument ``mode`` to :class:`pdb.Pdb`. Disabled ``restart``
* Add a new argument *mode* to :class:`pdb.Pdb`. Disable the ``restart``
command when :mod:`pdb` is in ``inline`` mode.
(Contributed by Tian Gao in :gh:`123757`.)

pickle
------

* Set the default protocol version on the :mod:`pickle` module to 5.
For more details, please see :ref:`pickle protocols <pickle-protocols>`.
For more details, see :ref:`pickle protocols <pickle-protocols>`.

* Add notes for pickle serialization errors that allow to identify the source
of the error.
Expand Down Expand Up @@ -379,6 +381,12 @@ asyncio
Deprecated
==========

* :mod:`asyncio`:
:func:`!asyncio.iscoroutinefunction` is deprecated
and will be removed in Python 3.16,
use :func:`inspect.iscoroutinefunction` instead.
(Contributed by Jiahao Li and Kumar Aditya in :gh:`122875`.)

* :mod:`builtins`:
Passing a complex number as the *real* or *imag* argument in the
:func:`complex` constructor is now deprecated; it should only be passed
Expand Down Expand Up @@ -437,7 +445,7 @@ ast
user-defined ``visit_Num``, ``visit_Str``, ``visit_Bytes``,
``visit_NameConstant`` and ``visit_Ellipsis`` methods on custom
:class:`ast.NodeVisitor` subclasses will no longer be called when the
``NodeVisitor`` subclass is visiting an AST. Define a ``visit_Constant``
:class:`!NodeVisitor` subclass is visiting an AST. Define a ``visit_Constant``
method instead.

Also, remove the following deprecated properties on :class:`ast.Constant`,
Expand Down Expand Up @@ -588,18 +596,18 @@ New Features
* Add a new :c:type:`PyUnicodeWriter` API to create a Python :class:`str`
object:

* :c:func:`PyUnicodeWriter_Create`.
* :c:func:`PyUnicodeWriter_Discard`.
* :c:func:`PyUnicodeWriter_Finish`.
* :c:func:`PyUnicodeWriter_WriteChar`.
* :c:func:`PyUnicodeWriter_WriteUTF8`.
* :c:func:`PyUnicodeWriter_WriteUCS4`.
* :c:func:`PyUnicodeWriter_WriteWideChar`.
* :c:func:`PyUnicodeWriter_WriteStr`.
* :c:func:`PyUnicodeWriter_WriteRepr`.
* :c:func:`PyUnicodeWriter_WriteSubstring`.
* :c:func:`PyUnicodeWriter_Format`.
* :c:func:`PyUnicodeWriter_DecodeUTF8Stateful`.
* :c:func:`PyUnicodeWriter_Create`
* :c:func:`PyUnicodeWriter_Discard`
* :c:func:`PyUnicodeWriter_Finish`
* :c:func:`PyUnicodeWriter_WriteChar`
* :c:func:`PyUnicodeWriter_WriteUTF8`
* :c:func:`PyUnicodeWriter_WriteUCS4`
* :c:func:`PyUnicodeWriter_WriteWideChar`
* :c:func:`PyUnicodeWriter_WriteStr`
* :c:func:`PyUnicodeWriter_WriteRepr`
* :c:func:`PyUnicodeWriter_WriteSubstring`
* :c:func:`PyUnicodeWriter_Format`
* :c:func:`PyUnicodeWriter_DecodeUTF8Stateful`

(Contributed by Victor Stinner in :gh:`119182`.)

Expand All @@ -611,11 +619,11 @@ New Features
is backwards incompatible to any C-Extension that holds onto an interned
string after a call to :c:func:`Py_Finalize` and is then reused after a
call to :c:func:`Py_Initialize`. Any issues arising from this behavior will
normally result in crashes during the exectuion of the subsequent call to
normally result in crashes during the execution of the subsequent call to
:c:func:`Py_Initialize` from accessing uninitialized memory. To fix, use
an address sanitizer to identify any use-after-free coming from
an interned string and deallocate it during module shutdown.
(Contribued by Eddie Elizondo in :gh:`113601`.)
(Contributed by Eddie Elizondo in :gh:`113601`.)

* Add new functions to convert C ``<stdint.h>`` numbers from/to Python
:class:`int`:
Expand Down Expand Up @@ -691,12 +699,7 @@ Deprecated
:c:macro:`!isfinite` available from :file:`math.h`
since C99. (Contributed by Sergey B Kirpichev in :gh:`119613`.)

* :func:`!asyncio.iscoroutinefunction` is deprecated
and will be removed in Python 3.16,
use :func:`inspect.iscoroutinefunction` instead.
(Contributed by Jiahao Li and Kumar Aditya in :gh:`122875`.)

.. Add deprecations above alphabetically, not here at the end.
.. Add C API deprecations above alphabetically, not here at the end.

.. include:: ../deprecations/c-api-pending-removal-in-3.15.rst

Expand Down
Loading