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