@@ -142,7 +142,7 @@ In the case where loading a lazily imported module fails (for example, if
142142the module does not exist), Python raises the exception at the point of
143143first use rather than at import time. The associated traceback includes both
144144the location where the name was accessed and the original import statement,
145- making it straightforward to diagnose & debug the failure.
145+ making it straightforward to diagnose and debug the failure.
146146
147147For cases where you want to enable lazy loading globally without modifying
148148source code, Python provides the :option: `-X lazy_imports <-X> ` command-line
@@ -451,14 +451,36 @@ Improved error messages
451451
452452 Running this code now produces a clearer suggestion:
453453
454- .. code-block :: pycon
454+ .. code-block :: pytb
455455
456456 Traceback (most recent call last):
457- File "/home/pablogsal/github/python/main/lel.py", line 42, in <module>
458- print(container.area)
459- ^^^^^^^^^^^^^^
457+ File "/home/pablogsal/github/python/main/lel.py", line 42, in <module>
458+ print(container.area)
459+ ^^^^^^^^^^^^^^
460460 AttributeError: 'Container' object has no attribute 'area'. Did you mean '.inner.area' instead of '.area'?
461461
462+ * The interpreter now tries to provide a suggestion when
463+ :func: `delattr ` fails due to a missing attribute.
464+ When an attribute name that closely resembles an existing attribute is used,
465+ the interpreter will suggest the correct attribute name in the error message.
466+ For example:
467+
468+ .. doctest ::
469+
470+ >>> class A :
471+ ... pass
472+ >>> a = A()
473+ >>> a.abcde = 1
474+ >>> del a.abcdf # doctest: +ELLIPSIS
475+ Traceback (most recent call last):
476+ ...
477+ AttributeError: 'A' object has no attribute 'abcdf'. Did you mean: 'abcde'?
478+
479+ (Contributed by Nikita Sobolev and Pranjal Prajapati in :gh: `136588 `.)
480+
481+ * Several error messages incorrectly using the term "argument" have been corrected.
482+ (Contributed by Stan Ulbrych in :gh: `133382 `.)
483+
462484
463485Other language changes
464486======================
@@ -490,28 +512,6 @@ Other language changes
490512
491513 (Contributed by Adam Turner in :gh: `133711 `; PEP 686 written by Inada Naoki.)
492514
493- * Several error messages incorrectly using the term "argument" have been corrected.
494- (Contributed by Stan Ulbrych in :gh: `133382 `.)
495-
496- * The interpreter now tries to provide a suggestion when
497- :func: `delattr ` fails due to a missing attribute.
498- When an attribute name that closely resembles an existing attribute is used,
499- the interpreter will suggest the correct attribute name in the error message.
500- For example:
501-
502- .. doctest ::
503-
504- >>> class A :
505- ... pass
506- >>> a = A()
507- >>> a.abcde = 1
508- >>> del a.abcdf # doctest: +ELLIPSIS
509- Traceback (most recent call last):
510- ...
511- AttributeError: 'A' object has no attribute 'abcdf'. Did you mean: 'abcde'?
512-
513- (Contributed by Nikita Sobolev and Pranjal Prajapati in :gh: `136588 `.)
514-
515515* Unraisable exceptions are now highlighted with color by default. This can be
516516 controlled by :ref: `environment variables <using-on-controlling-color >`.
517517 (Contributed by Peter Bierma in :gh: `134170 `.)
@@ -708,7 +708,7 @@ base64
708708 (Contributed by Serhiy Storchaka in :gh: `143214 ` and :gh: `146431 `.)
709709
710710* Added the *ignorechars * parameter in :func: `~base64.b16decode `,
711- :func: `~base64.b32decode `, :func: `~base64.b32hexdecode `,
711+ :func: `~base64.b32decode `, :func: `~base64.b32hexdecode `,
712712 :func: `~base64.b64decode `, :func: `~base64.b85decode `, and
713713 :func: `~base64.z85decode `.
714714 (Contributed by Serhiy Storchaka in :gh: `144001 ` and :gh: `146431 `.)
@@ -880,13 +880,13 @@ inspect
880880json
881881----
882882
883- * Add the *array_hook * parameter to :func: `~json.load ` and
883+ * Add the *array_hook * parameter to :func: `~json.load ` and
884884 :func: `~json.loads ` functions:
885885 allow a callback for JSON literal array types to customize Python lists in
886886 the resulting decoded object. Passing combined :class: `frozendict ` to
887887 *object_pairs_hook * param and :class: `tuple ` to ``array_hook `` will yield a
888888 deeply nested immutable Python structure representing the JSON data.
889- (Contributed by Joao S. O. Bueno in :gh: `146440 `)
889+ (Contributed by Joao S. O. Bueno in :gh: `146440 `. )
890890
891891
892892locale
@@ -914,23 +914,11 @@ math
914914mimetypes
915915---------
916916
917- * Add ``application/dicom `` MIME type for ``.dcm `` extension.
918- (Contributed by Benedikt Johannes in :gh: `144217 `.)
919- * Add ``application/efi ``. (Contributed by Charlie Lin in :gh: `145720 `.)
920- * Add ``application/node `` MIME type for ``.cjs `` extension.
921- (Contributed by John Franey in :gh: `140937 `.)
922- * Add ``application/toml ``. (Contributed by Gil Forcada in :gh: `139959 `.)
923- * Add ``application/sql `` and ``application/vnd.sqlite3 ``.
924- (Contributed by Charlie Lin in :gh: `145698 `.)
925- * Add the following MIME types:
926-
927- - ``application/vnd.ms-cab-compressed `` for ``.cab `` extension
928- - ``application/vnd.ms-htmlhelp `` for ``.chm `` extension
929- - ``application/vnd.ms-officetheme `` for ``.thmx `` extension
930-
931- (Contributed by Charlie Lin in :gh: `145718 `.)
932-
933- * Add ``image/jxl ``. (Contributed by Foolbar in :gh: `144213 `.)
917+ * Add more MIME types.
918+ (Contributed by Benedikt Johannes, Charlie Lin, Foolbar, Gil Forcada and
919+ John Franey
920+ in :gh: `144217 `, :gh: `145720 `, :gh: `140937 `, :gh: `139959 `, :gh: `145698 `,
921+ :gh: `145718 ` and :gh: `144213 `.)
934922* Rename ``application/x-texinfo `` to ``application/texinfo ``.
935923 (Contributed by Charlie Lin in :gh: `140165 `.)
936924* Changed the MIME type for ``.ai `` files to ``application/pdf ``.
@@ -1114,7 +1102,7 @@ subprocess
11141102
11151103 If none of these mechanisms are available, the function falls back to the
11161104 traditional busy loop (non-blocking call and short sleeps).
1117- (Contributed by Giampaolo Rodola in :gh: `83069 `).
1105+ (Contributed by Giampaolo Rodola in :gh: `83069 `.)
11181106
11191107
11201108symtable
@@ -1171,7 +1159,7 @@ timeit
11711159
11721160* Make the target time of :meth: `timeit.Timer.autorange ` configurable
11731161 and add ``--target-time `` option to the command-line interface.
1174- (Contributed by Alessandro Cucci and Miikka Koskinen in :gh: `140283 `.)
1162+ (Contributed by Alessandro Cucci and Miikka Koskinen in :gh: `80642 `.)
11751163
11761164
11771165tkinter
@@ -1216,10 +1204,7 @@ tomllib
12161204 Previously an inline table had to be on a single line and couldn't end
12171205 with a trailing comma. This is now relaxed so that the following is valid:
12181206
1219- .. syntax highlighting needs TOML 1.1.0 support in Pygments,
1220- see https://github.com/pygments/pygments/issues/3026
1221-
1222- .. code-block :: text
1207+ .. code-block :: toml
12231208
12241209 tbl = {
12251210 key = "a string",
@@ -1231,15 +1216,15 @@ tomllib
12311216 - Add ``\xHH `` notation to basic strings for codepoints under 255,
12321217 and the ``\e `` escape for the escape character:
12331218
1234- .. code-block :: text
1219+ .. code-block :: toml
12351220
12361221 null = "null byte: \x00; letter a: \x61"
12371222 csi = "\e["
12381223
12391224 - Seconds in datetime and time values are now optional.
12401225 The following are now valid:
12411226
1242- .. code-block :: text
1227+ .. code-block :: toml
12431228
12441229 dt = 2010-02-03 14:15
12451230 t = 14:15
@@ -1421,7 +1406,7 @@ Optimizations
14211406=============
14221407
14231408* ``mimalloc `` is now used as the default allocator for
1424- for raw memory allocations such as via :c:func: `PyMem_RawMalloc `
1409+ raw memory allocations such as via :c:func: `PyMem_RawMalloc `
14251410 for better performance on :term: `free-threaded builds <free-threaded build> `.
14261411 (Contributed by Kumar Aditya in :gh: `144914 `.)
14271412
@@ -1440,7 +1425,7 @@ base64 & binascii
14401425
14411426* Implementation for Base32 has been rewritten in C.
14421427 Encoding and decoding is now two orders of magnitude faster.
1443- (Contributed by James Seo in :gh: `146192 `)
1428+ (Contributed by James Seo in :gh: `146192 `. )
14441429
14451430
14461431csv
@@ -1534,7 +1519,7 @@ The JIT compiler's machine code generator now produces better machine code
15341519for x86-64 and AArch64 macOS and Linux targets. In general, users should
15351520experience lower memory usage for generated machine code and more efficient
15361521machine code versus 3.14.
1537- (Contributed by Brandt Bucher in :gh: `136528 ` and :gh: `136528 `.
1522+ (Contributed by Brandt Bucher in :gh: `136528 ` and :gh: `135905 `.
15381523Implementation for AArch64 contributed by Mark Shannon in :gh: `139855 `.
15391524Additional optimizations for AArch64 contributed by Mark Shannon and
15401525Diego Russo in :gh: `140683 ` and :gh: `142305 `.)
@@ -1557,6 +1542,14 @@ collections.abc
15571542 deprecated since Python 3.12, and is scheduled for removal in Python 3.17.
15581543
15591544
1545+ ctypes
1546+ ------
1547+
1548+ * Removed the undocumented function :func: `!ctypes.SetPointerType `,
1549+ which has been deprecated since Python 3.13.
1550+ (Contributed by Bénédikt Tran in :gh: `133866 `.)
1551+
1552+
15601553datetime
15611554--------
15621555
@@ -1566,14 +1559,6 @@ datetime
15661559 (Contributed by Stan Ulbrych and Gregory P. Smith in :gh: `70647 `.)
15671560
15681561
1569- ctypes
1570- ------
1571-
1572- * Removed the undocumented function :func: `!ctypes.SetPointerType `,
1573- which has been deprecated since Python 3.13.
1574- (Contributed by Bénédikt Tran in :gh: `133866 `.)
1575-
1576-
15771562glob
15781563----
15791564
@@ -1658,6 +1643,9 @@ typing
16581643 or ``TD = TypedDict("TD", {}) `` instead.
16591644 (Contributed by Bénédikt Tran in :gh: `133823 `.)
16601645
1646+ * Deprecated :func: `!typing.no_type_check_decorator ` has been removed.
1647+ (Contributed by Nikita Sobolev in :gh: `133601 `.)
1648+
16611649
16621650wave
16631651----
@@ -1773,8 +1761,6 @@ New deprecations
17731761 :func: `issubclass `, but warnings were not previously emitted if it was
17741762 merely imported or accessed from the :mod: `!typing ` module.
17751763
1776- * Deprecated :func: `!typing.no_type_check_decorator ` has been removed.
1777- (Contributed by Nikita Sobolev in :gh: `133601 `.)
17781764
17791765* ``__version__ ``
17801766
@@ -2061,8 +2047,8 @@ Deprecated C APIs
20612047
20622048 - :c:macro: `Py_ALIGNED `: Prefer ``alignas `` instead.
20632049 - :c:macro: `PY_FORMAT_SIZE_T `: Use ``"z" `` directly.
2064- - :c:macro: `Py_LL ` & :c:macro: `Py_ULL `:
2065- Use standard suffixes, ``LL `` & ``ULL ``.
2050+ - :c:macro: `Py_LL ` and :c:macro: `Py_ULL `:
2051+ Use standard suffixes, ``LL `` and ``ULL ``.
20662052 - :c:macro: `PY_LONG_LONG `, :c:macro: `PY_LLONG_MIN `, :c:macro: `PY_LLONG_MAX `,
20672053 :c:macro: `PY_ULLONG_MAX `, :c:macro: `PY_INT32_T `, :c:macro: `PY_UINT32_T `,
20682054 :c:macro: `PY_INT64_T `, :c:macro: `PY_UINT64_T `, :c:macro: `PY_SIZE_MAX `:
0 commit comments