Skip to content

Commit ec7ffa4

Browse files
authored
bpo-41137: Reorganize What's New in Python 3.11 (GH-28518)
* Merge the two Removed sections. * Move "Build Changes" at the end, before "C API Changes". * Move the pdb change in Porting to Python 3.11. * Move C API new features in their section.
1 parent 8c21941 commit ec7ffa4

File tree

1 file changed

+77
-78
lines changed

1 file changed

+77
-78
lines changed

Doc/whatsnew/3.11.rst

+77-78
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,68 @@ unicodedata
250250
* The Unicode database has been updated to version 14.0.0. (:issue:`45190`).
251251

252252

253+
Optimizations
254+
=============
255+
256+
* Compiler now optimizes simple C-style formatting with literal format
257+
containing only format codes ``%s``, ``%r`` and ``%a`` and makes it as
258+
fast as corresponding f-string expression.
259+
(Contributed by Serhiy Storchaka in :issue:`28307`.)
260+
261+
* "Zero-cost" exceptions are implemented. The cost of ``try`` statements is
262+
almost eliminated when no exception is raised.
263+
(Contributed by Mark Shannon in :issue:`40222`.)
264+
265+
* Method calls with keywords are now faster due to bytecode
266+
changes which avoid creating bound method instances. Previously, this
267+
optimization was applied only to method calls with purely positional
268+
arguments.
269+
(Contributed by Ken Jin and Mark Shannon in :issue:`26110`, based on ideas
270+
implemented in PyPy.)
271+
272+
* Pure ASCII strings are now normalized in constant time by :func:`unicodedata.normalize`.
273+
(Contributed by Dong-hee Na in :issue:`44987`.)
274+
275+
276+
CPython bytecode changes
277+
========================
278+
279+
* Added a new :opcode:`CALL_METHOD_KW` opcode. Calls a method in a similar
280+
fashion as :opcode:`CALL_METHOD`, but also supports keyword arguments. Works
281+
in tandem with :opcode:`LOAD_METHOD`.
282+
283+
284+
Deprecated
285+
==========
286+
287+
* The :mod:`lib2to3` package is now deprecated and may not be able to parse
288+
Python 3.10 or newer. See the :pep:`617` (New PEG parser for CPython).
289+
(Contributed by Victor Stinner in :issue:`40360`.)
290+
291+
* :class:`webbrowser.MacOSX` is deprecated and will be removed in Python 3.13.
292+
It is untested and undocumented and also not used by webbrowser itself.
293+
(Contributed by Dong-hee Na in :issue:`42255`.)
294+
295+
* The behavior of returning a value from a :class:`~unittest.TestCase` and
296+
:class:`~unittest.IsolatedAsyncioTestCase` test methods (other than the
297+
default ``None`` value), is now deprecated.
298+
299+
* Deprecated the following :mod:`unittest` functions, scheduled for removal in
300+
Python 3.13:
301+
302+
* :func:`unittest.findTestCases`
303+
* :func:`unittest.makeSuite`
304+
* :func:`unittest.getTestCaseNames`
305+
306+
Use :class:`~unittest.TestLoader` method instead:
307+
308+
* :meth:`unittest.TestLoader.loadTestsFromModule`
309+
* :meth:`unittest.TestLoader.loadTestsFromTestCase`
310+
* :meth:`unittest.TestLoader.getTestCaseNames`
311+
312+
(Contributed by Erlend E. Aasland in :issue:`5846`.)
313+
314+
253315
Removed
254316
=======
255317

@@ -323,81 +385,6 @@ Removed
323385
deprecated since Python 3.2.
324386
(Contributed by Hugo van Kemenade in :issue:`45173`.)
325387

326-
327-
Optimizations
328-
=============
329-
330-
* Compiler now optimizes simple C-style formatting with literal format
331-
containing only format codes ``%s``, ``%r`` and ``%a`` and makes it as
332-
fast as corresponding f-string expression.
333-
(Contributed by Serhiy Storchaka in :issue:`28307`.)
334-
335-
* "Zero-cost" exceptions are implemented. The cost of ``try`` statements is
336-
almost eliminated when no exception is raised.
337-
(Contributed by Mark Shannon in :issue:`40222`.)
338-
339-
* Method calls with keywords are now faster due to bytecode
340-
changes which avoid creating bound method instances. Previously, this
341-
optimization was applied only to method calls with purely positional
342-
arguments.
343-
(Contributed by Ken Jin and Mark Shannon in :issue:`26110`, based on ideas
344-
implemented in PyPy.)
345-
346-
* :file:`.pdbrc` is now read with ``'utf-8'`` encoding.
347-
348-
* Pure ASCII strings are now normalized in constant time by :func:`unicodedata.normalize`.
349-
(Contributed by Dong-hee Na in :issue:`44987`.)
350-
351-
352-
CPython bytecode changes
353-
========================
354-
355-
* Added a new :opcode:`CALL_METHOD_KW` opcode. Calls a method in a similar
356-
fashion as :opcode:`CALL_METHOD`, but also supports keyword arguments. Works
357-
in tandem with :opcode:`LOAD_METHOD`.
358-
359-
360-
Build Changes
361-
=============
362-
363-
* CPython can now be built with the ThinLTO option via ``--with-lto=thin``.
364-
(Contributed by Dong-hee Na and Brett Holman in :issue:`44340`.)
365-
366-
367-
Deprecated
368-
==========
369-
370-
* The :mod:`lib2to3` package is now deprecated and may not be able to parse
371-
Python 3.10 or newer. See the :pep:`617` (New PEG parser for CPython).
372-
(Contributed by Victor Stinner in :issue:`40360`.)
373-
374-
* :class:`webbrowser.MacOSX` is deprecated and will be removed in Python 3.13.
375-
It is untested and undocumented and also not used by webbrowser itself.
376-
(Contributed by Dong-hee Na in :issue:`42255`.)
377-
378-
* The behavior of returning a value from a :class:`~unittest.TestCase` and
379-
:class:`~unittest.IsolatedAsyncioTestCase` test methods (other than the
380-
default ``None`` value), is now deprecated.
381-
382-
* Deprecated the following :mod:`unittest` functions, scheduled for removal in
383-
Python 3.13:
384-
385-
* :func:`unittest.findTestCases`
386-
* :func:`unittest.makeSuite`
387-
* :func:`unittest.getTestCaseNames`
388-
389-
Use :class:`~unittest.TestLoader` method instead:
390-
391-
* :meth:`unittest.TestLoader.loadTestsFromModule`
392-
* :meth:`unittest.TestLoader.loadTestsFromTestCase`
393-
* :meth:`unittest.TestLoader.getTestCaseNames`
394-
395-
(Contributed by Erlend E. Aasland in :issue:`5846`.)
396-
397-
398-
Removed
399-
=======
400-
401388
* The :func:`@asyncio.coroutine <asyncio.coroutine>` :term:`decorator` enabling
402389
legacy generator-based coroutines to be compatible with async/await code.
403390
The function has been deprecated since Python 3.8 and the removal was
@@ -435,18 +422,30 @@ Changes in the Python API
435422
how universal newlines works.
436423
(Contributed by Victor Stinner in :issue:`37330`.)
437424

425+
* The :mod:`pdb` module now reads the :file:`.pdbrc` configuration file with
426+
the ``'utf-8'`` encoding.
427+
(Contributed by Srinivas Reddy Thatiparthy (శ్రీనివాస్ రెడ్డి తాటిపర్తి) in :issue:`41137`.)
428+
429+
430+
Build Changes
431+
=============
432+
433+
* CPython can now be built with the ThinLTO option via ``--with-lto=thin``.
434+
(Contributed by Dong-hee Na and Brett Holman in :issue:`44340`.)
435+
438436

439437
C API Changes
440438
=============
439+
440+
New Features
441+
------------
442+
441443
* Add a new :c:func:`PyType_GetName` function to get type's short name.
442444
(Contributed by Hai Shi in :issue:`42035`.)
443445

444446
* Add a new :c:func:`PyType_GetQualName` function to get type's qualified name.
445447
(Contributed by Hai Shi in :issue:`42035`.)
446448

447-
New Features
448-
------------
449-
450449
Porting to Python 3.11
451450
----------------------
452451

0 commit comments

Comments
 (0)