@@ -465,45 +465,9 @@ and others in :gh:`103764`.)
465
465
Other Language Changes
466
466
======================
467
467
468
- * Add :ref: `support for the perf profiler <perf_profiling >` through the new
469
- environment variable :envvar: `PYTHONPERFSUPPORT `
470
- and command-line option :option: `-X perf <-X> `,
471
- as well as the new :func: `sys.activate_stack_trampoline `,
472
- :func: `sys.deactivate_stack_trampoline `,
473
- and :func: `sys.is_stack_trampoline_active ` functions.
474
- (Design by Pablo Galindo. Contributed by Pablo Galindo and Christian Heimes
475
- with contributions from Gregory P. Smith [Google] and Mark Shannon
476
- in :gh: `96123 `.)
477
-
478
- * The extraction methods in :mod: `tarfile `, and :func: `shutil.unpack_archive `,
479
- have a new a *filter * argument that allows limiting tar features than may be
480
- surprising or dangerous, such as creating files outside the destination
481
- directory.
482
- See :ref: `tarfile extraction filters <tarfile-extraction-filter >` for details.
483
- In Python 3.14, the default will switch to ``'data' ``.
484
- (Contributed by Petr Viktorin in :pep: `706 `.)
485
-
486
- * :class: `types.MappingProxyType ` instances are now hashable if the underlying
487
- mapping is hashable.
488
- (Contributed by Serhiy Storchaka in :gh: `87995 `.)
489
-
490
- * :class: `memoryview ` now supports the half-float type (the "e" format code).
491
- (Contributed by Donghee Na and Antoine Pitrou in :gh: `90751 `.)
492
-
493
468
* The parser now raises :exc: `SyntaxError ` when parsing source code containing
494
469
null bytes. (Contributed by Pablo Galindo in :gh: `96670 `.)
495
470
496
- * :func: `ast.parse ` now raises :exc: `SyntaxError ` instead of :exc: `ValueError `
497
- when parsing source code containing null bytes. (Contributed by Pablo Galindo
498
- in :gh: `96670 `.)
499
-
500
- * The Garbage Collector now runs only on the eval breaker mechanism of the
501
- Python bytecode evaluation loop instead of object allocations. The GC can
502
- also run when :c:func: `PyErr_CheckSignals ` is called so C extensions that
503
- need to run for a long time without executing any Python code also have a
504
- chance to execute the GC periodically. (Contributed by Pablo Galindo in
505
- :gh: `97922 `.)
506
-
507
471
* A backslash-character pair that is not a valid escape sequence now generates
508
472
a :exc: `SyntaxWarning `, instead of :exc: `DeprecationWarning `.
509
473
For example, ``re.compile("\d+\.\d+") `` now emits a :exc: `SyntaxWarning `
@@ -519,24 +483,13 @@ Other Language Changes
519
483
In a future Python version they will be eventually a :exc: `SyntaxError `.
520
484
(Contributed by Victor Stinner in :gh: `98401 `.)
521
485
522
- * All builtin and extension callables expecting boolean parameters now accept
523
- arguments of any type instead of just :class: `bool ` and :class: `int `.
524
- (Contributed by Serhiy Storchaka in :gh: `60203 `.)
525
-
526
486
* Variables used in the target part of comprehensions that are not stored to
527
487
can now be used in assignment expressions (``:= ``).
528
488
For example, in ``[(b := 1) for a, b.prop in some_iter] ``, the assignment to
529
489
``b `` is now allowed. Note that assigning to variables stored to in the target
530
490
part of comprehensions (like ``a ``) is still disallowed, as per :pep: `572 `.
531
491
(Contributed by Nikita Sobolev in :gh: `100581 `.)
532
492
533
- * :class: `slice ` objects are now hashable, allowing them to be used as dict keys and
534
- set items. (Contributed by Will Bradshaw, Furkan Onder, and Raymond Hettinger in :gh: `101264 `.)
535
-
536
- * :func: `sum ` now uses Neumaier summation to improve accuracy and commutativity
537
- when summing floats or mixed ints and floats.
538
- (Contributed by Raymond Hettinger in :gh: `100425 `.)
539
-
540
493
* Exceptions raised in a class or type's ``__set_name__ `` method are no longer
541
494
wrapped by a :exc: `RuntimeError `. Context information is added to the
542
495
exception as a :pep: `678 ` note. (Contributed by Irit Katriel in :gh: `77757 `.)
@@ -546,6 +499,53 @@ Other Language Changes
546
499
:exc: `ExceptionGroup `. Also changed in version 3.11.4. (Contributed by Irit
547
500
Katriel in :gh: `103590 `.)
548
501
502
+ * The Garbage Collector now runs only on the eval breaker mechanism of the
503
+ Python bytecode evaluation loop instead of object allocations. The GC can
504
+ also run when :c:func: `PyErr_CheckSignals ` is called so C extensions that
505
+ need to run for a long time without executing any Python code also have a
506
+ chance to execute the GC periodically. (Contributed by Pablo Galindo in
507
+ :gh: `97922 `.)
508
+
509
+ * All builtin and extension callables expecting boolean parameters now accept
510
+ arguments of any type instead of just :class: `bool ` and :class: `int `.
511
+ (Contributed by Serhiy Storchaka in :gh: `60203 `.)
512
+
513
+ * :class: `memoryview ` now supports the half-float type (the "e" format code).
514
+ (Contributed by Donghee Na and Antoine Pitrou in :gh: `90751 `.)
515
+
516
+ * :class: `slice ` objects are now hashable, allowing them to be used as dict keys and
517
+ set items. (Contributed by Will Bradshaw, Furkan Onder, and Raymond Hettinger in :gh: `101264 `.)
518
+
519
+ * :func: `sum ` now uses Neumaier summation to improve accuracy and commutativity
520
+ when summing floats or mixed ints and floats.
521
+ (Contributed by Raymond Hettinger in :gh: `100425 `.)
522
+
523
+ * :func: `ast.parse ` now raises :exc: `SyntaxError ` instead of :exc: `ValueError `
524
+ when parsing source code containing null bytes. (Contributed by Pablo Galindo
525
+ in :gh: `96670 `.)
526
+
527
+ * The extraction methods in :mod: `tarfile `, and :func: `shutil.unpack_archive `,
528
+ have a new a *filter * argument that allows limiting tar features than may be
529
+ surprising or dangerous, such as creating files outside the destination
530
+ directory.
531
+ See :ref: `tarfile extraction filters <tarfile-extraction-filter >` for details.
532
+ In Python 3.14, the default will switch to ``'data' ``.
533
+ (Contributed by Petr Viktorin in :pep: `706 `.)
534
+
535
+ * :class: `types.MappingProxyType ` instances are now hashable if the underlying
536
+ mapping is hashable.
537
+ (Contributed by Serhiy Storchaka in :gh: `87995 `.)
538
+
539
+ * Add :ref: `support for the perf profiler <perf_profiling >` through the new
540
+ environment variable :envvar: `PYTHONPERFSUPPORT `
541
+ and command-line option :option: `-X perf <-X> `,
542
+ as well as the new :func: `sys.activate_stack_trampoline `,
543
+ :func: `sys.deactivate_stack_trampoline `,
544
+ and :func: `sys.is_stack_trampoline_active ` functions.
545
+ (Design by Pablo Galindo. Contributed by Pablo Galindo and Christian Heimes
546
+ with contributions from Gregory P. Smith [Google] and Mark Shannon
547
+ in :gh: `96123 `.)
548
+
549
549
550
550
New Modules
551
551
===========
0 commit comments