Skip to content

Commit ea5965a

Browse files
committed
Merge branch 'main' into gsallam/main
* main: (30 commits) pythongh-103987: fix several crashes in mmap module (python#103990) docs: fix wrong indentation causing rendering error in dis page (python#104661) pythongh-94906: Support multiple steps in math.nextafter (python#103881) pythongh-104472: Skip `test_subprocess.ProcessTestCase.test_empty_env` if ASAN is enabled (python#104667) pythongh-103839: Allow building Tkinter against Tcl 8.7 without external libtommath (pythonGH-103842) pythongh-85984: New additions and improvements to the tty library. (python#101832) pythongh-104659: Consolidate python examples in enum documentation (python#104665) pythongh-92248: Deprecate `type`, `choices`, `metavar` parameters of `argparse.BooleanOptionalAction` (python#103678) pythongh-104645: fix error handling in marshal tests (python#104646) pythongh-104600: Make type.__type_params__ writable (python#104634) pythongh-104602: Add additional test for listcomp with lambda (python#104639) pythongh-104640: Disallow walrus in comprehension within type scopes (python#104641) pythongh-103921: Rename "type" header in argparse docs (python#104654) Improve readability of `typing._ProtocolMeta.__instancecheck__` (python#104649) pythongh-96522: Fix deadlock in pty.spawn (python#96639) pythonGH-102818: Do not call `PyTraceBack_Here` in sys.settrace trampoline. (pythonGH-104579) pythonGH-103545: Add macOS specific constants for ``os.setpriority`` to ``os`` (python#104606) pythongh-104623: Update macOS installer to SQLite 3.42.0 (pythonGH-104624) pythongh-104619: never leak comprehension locals to outer locals() (python#104637) pythongh-104602: ensure all cellvars are known up front (python#104603) ...
2 parents 6585f32 + ceaa4c3 commit ea5965a

File tree

80 files changed

+1254
-299
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+1254
-299
lines changed

Doc/library/argparse.rst

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -57,20 +57,20 @@ the extracted data in a :class:`argparse.Namespace` object::
5757
Quick Links for add_argument()
5858
------------------------------
5959

60-
====================== =========================================================== ==========================================================================================================================
61-
Name Description Values
62-
====================== =========================================================== ==========================================================================================================================
63-
action_ Specify how an argument should be handled ``'store'``, ``'store_const'``, ``'store_true'``, ``'append'``, ``'append_const'``, ``'count'``, ``'help'``, ``'version'``
64-
choices_ Limit values to a specific set of choices ``['foo', 'bar']``, ``range(1, 10)``, or :class:`~collections.abc.Container` instance
65-
const_ Store a constant value
66-
default_ Default value used when an argument is not provided Defaults to ``None``
67-
dest_ Specify the attribute name used in the result namespace
68-
help_ Help message for an argument
69-
metavar_ Alternate display name for the argument as shown in help
70-
nargs_ Number of times the argument can be used :class:`int`, ``'?'``, ``'*'``, or ``'+'``
71-
required_ Indicate whether an argument is required or optional ``True`` or ``False``
72-
type_ Automatically convert an argument to the given type :class:`int`, :class:`float`, ``argparse.FileType('w')``, or callable function
73-
====================== =========================================================== ==========================================================================================================================
60+
============================ =========================================================== ==========================================================================================================================
61+
Name Description Values
62+
============================ =========================================================== ==========================================================================================================================
63+
action_ Specify how an argument should be handled ``'store'``, ``'store_const'``, ``'store_true'``, ``'append'``, ``'append_const'``, ``'count'``, ``'help'``, ``'version'``
64+
choices_ Limit values to a specific set of choices ``['foo', 'bar']``, ``range(1, 10)``, or :class:`~collections.abc.Container` instance
65+
const_ Store a constant value
66+
default_ Default value used when an argument is not provided Defaults to ``None``
67+
dest_ Specify the attribute name used in the result namespace
68+
help_ Help message for an argument
69+
metavar_ Alternate display name for the argument as shown in help
70+
nargs_ Number of times the argument can be used :class:`int`, ``'?'``, ``'*'``, or ``'+'``
71+
required_ Indicate whether an argument is required or optional ``True`` or ``False``
72+
:ref:`type <argparse-type>` Automatically convert an argument to the given type :class:`int`, :class:`float`, ``argparse.FileType('w')``, or callable function
73+
============================ =========================================================== ==========================================================================================================================
7474

7575

7676
Example
@@ -1132,7 +1132,7 @@ command-line argument was not present::
11321132
Namespace(foo='1')
11331133

11341134

1135-
.. _type:
1135+
.. _argparse-type:
11361136

11371137
type
11381138
^^^^

Doc/library/dis.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -622,8 +622,8 @@ not have to be) the original ``STACK[-2]``.
622622

623623
.. versionadded:: 3.8
624624

625-
.. versionchanged:: 3.11
626-
Exception representation on the stack now consist of one, not three, items.
625+
.. versionchanged:: 3.11
626+
Exception representation on the stack now consist of one, not three, items.
627627

628628

629629
.. opcode:: CLEANUP_THROW

Doc/library/enum.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -406,18 +406,18 @@ Data Types
406406
with an *IntEnum* member, the resulting value loses its enumeration status.
407407

408408
>>> from enum import IntEnum
409-
>>> class Numbers(IntEnum):
409+
>>> class Number(IntEnum):
410410
... ONE = 1
411411
... TWO = 2
412412
... THREE = 3
413413
...
414-
>>> Numbers.THREE
415-
<Numbers.THREE: 3>
416-
>>> Numbers.ONE + Numbers.TWO
414+
>>> Number.THREE
415+
<Number.THREE: 3>
416+
>>> Number.ONE + Number.TWO
417417
3
418-
>>> Numbers.THREE + 5
418+
>>> Number.THREE + 5
419419
8
420-
>>> Numbers.THREE == 3
420+
>>> Number.THREE == 3
421421
True
422422

423423
.. note::

Doc/library/math.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,11 +224,11 @@ Number-theoretic and representation functions
224224
of *x* and are floats.
225225

226226

227-
.. function:: nextafter(x, y)
227+
.. function:: nextafter(x, y, steps=1)
228228

229-
Return the next floating-point value after *x* towards *y*.
229+
Return the floating-point value *steps* steps after *x* towards *y*.
230230

231-
If *x* is equal to *y*, return *y*.
231+
If *x* is equal to *y*, return *y*, unless *steps* is zero.
232232

233233
Examples:
234234

@@ -239,6 +239,9 @@ Number-theoretic and representation functions
239239

240240
See also :func:`math.ulp`.
241241

242+
.. versionchanged:: 3.12
243+
Added the *steps* argument.
244+
242245
.. versionadded:: 3.9
243246

244247
.. function:: perm(n, k=None)

Doc/library/os.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,17 @@ process and user.
493493
.. versionadded:: 3.3
494494

495495

496+
.. data:: PRIO_DARWIN_THREAD
497+
PRIO_DARWIN_PROCESS
498+
PRIO_DARWIN_BG
499+
PRIO_DARWIN_NONUI
500+
501+
Parameters for the :func:`getpriority` and :func:`setpriority` functions.
502+
503+
.. availability:: macOS
504+
505+
.. versionadded:: 3.12
506+
496507
.. function:: getresuid()
497508

498509
Return a tuple (ruid, euid, suid) denoting the current process's

Doc/library/pathlib.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ Pure paths provide the following methods and properties:
546546
PureWindowsPath('c:/Program Files')
547547

548548

549-
.. method:: PurePath.match(pattern)
549+
.. method:: PurePath.match(pattern, *, case_sensitive=None)
550550

551551
Match this path against the provided glob-style pattern. Return ``True``
552552
if matching is successful, ``False`` otherwise.
@@ -576,6 +576,11 @@ Pure paths provide the following methods and properties:
576576
>>> PureWindowsPath('b.py').match('*.PY')
577577
True
578578

579+
Set *case_sensitive* to ``True`` or ``False`` to override this behaviour.
580+
581+
.. versionadded:: 3.12
582+
The *case_sensitive* argument.
583+
579584

580585
.. method:: PurePath.relative_to(other, walk_up=False)
581586

Doc/library/tty.rst

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,36 @@ Because it requires the :mod:`termios` module, it will work only on Unix.
2020
The :mod:`tty` module defines the following functions:
2121

2222

23+
.. function:: cfmakeraw(mode)
24+
25+
Convert the tty attribute list *mode*, which is a list like the one returned
26+
by :func:`termios.tcgetattr`, to that of a tty in raw mode.
27+
28+
.. versionadded:: 3.12
29+
30+
31+
.. function:: cfmakecbreak(mode)
32+
33+
Convert the tty attribute list *mode*, which is a list like the one returned
34+
by :func:`termios.tcgetattr`, to that of a tty in cbreak mode.
35+
36+
.. versionadded:: 3.12
37+
38+
2339
.. function:: setraw(fd, when=termios.TCSAFLUSH)
2440

2541
Change the mode of the file descriptor *fd* to raw. If *when* is omitted, it
2642
defaults to :const:`termios.TCSAFLUSH`, and is passed to
27-
:func:`termios.tcsetattr`.
43+
:func:`termios.tcsetattr`. The return value of :func:`termios.tcgetattr`
44+
is saved before setting *fd* to raw mode; this value is returned.
2845

2946

3047
.. function:: setcbreak(fd, when=termios.TCSAFLUSH)
3148

3249
Change the mode of file descriptor *fd* to cbreak. If *when* is omitted, it
3350
defaults to :const:`termios.TCSAFLUSH`, and is passed to
34-
:func:`termios.tcsetattr`.
51+
:func:`termios.tcsetattr`. The return value of :func:`termios.tcgetattr`
52+
is saved before setting *fd* to cbreak mode; this value is returned.
3553

3654

3755
.. seealso::

Doc/whatsnew/3.12.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,9 @@ pathlib
395395
* Add :meth:`pathlib.Path.is_junction` as a proxy to :func:`os.path.isjunction`.
396396
(Contributed by Charles Machalow in :gh:`99547`.)
397397

398+
* Add *case_sensitive* optional parameter to :meth:`pathlib.Path.glob`,
399+
:meth:`pathlib.Path.rglob` and :meth:`pathlib.PurePath.match` for matching
400+
the path's case sensitivity, allowing for more precise control over the matching process.
398401

399402
dis
400403
---
@@ -867,6 +870,11 @@ Pending Removal in Python 3.14
867870
* The *onerror* argument of :func:`shutil.rmtree` is deprecated in 3.12,
868871
and will be removed in 3.14.
869872

873+
* The *type*, *choices*, and *metavar* parameters
874+
of :class:`!argparse.BooleanOptionalAction` are deprecated
875+
and will be removed in 3.14.
876+
(Contributed by Nikita Sobolev in :gh:`92248`.)
877+
870878
* :func:`pkgutil.find_loader` and :func:`pkgutil.get_loader`
871879
now raise :exc:`DeprecationWarning`;
872880
use :func:`importlib.util.find_spec` instead.

Include/internal/pycore_compile.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@ PyAPI_FUNC(PyObject*) _PyCompile_CodeGen(
105105

106106
PyAPI_FUNC(PyObject*) _PyCompile_OptimizeCfg(
107107
PyObject *instructions,
108-
PyObject *consts);
108+
PyObject *consts,
109+
int nlocals);
109110

110111
PyAPI_FUNC(PyCodeObject*)
111112
_PyCompile_Assemble(_PyCompile_CodeUnitMetadata *umd, PyObject *filename,

Include/internal/pycore_global_objects.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ struct _Py_interp_cached_objects {
7575
PyTypeObject *paramspec_type;
7676
PyTypeObject *paramspecargs_type;
7777
PyTypeObject *paramspeckwargs_type;
78-
PyTypeObject *typealias_type;
7978
};
8079

8180
#define _Py_INTERP_STATIC_OBJECT(interp, NAME) \

0 commit comments

Comments
 (0)