``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`.)
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.
* 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
------
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.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`.)
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``.
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`.)
: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`.)
------
* 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.
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
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`,
* 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`.)
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`:
: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