Skip to content

Commit 13d3b8e

Browse files
authored
Merge branch 'main' into gh-140578
2 parents 5db29e4 + f5394c2 commit 13d3b8e

Some content is hidden

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

61 files changed

+530
-134
lines changed

Doc/c-api/capsule.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Refer to :ref:`using-capsules` for more information on using these objects.
1515
.. c:type:: PyCapsule
1616
1717
This subtype of :c:type:`PyObject` represents an opaque value, useful for C
18-
extension modules who need to pass an opaque value (as a :c:expr:`void*`
18+
extension modules which need to pass an opaque value (as a :c:expr:`void*`
1919
pointer) through Python code to other C code. It is often used to make a C
2020
function pointer defined in one module available to other modules, so the
2121
regular import mechanism can be used to access C APIs defined in dynamically

Doc/c-api/code.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ may change without deprecation warnings.
289289
290290
.. c:function:: Py_ssize_t PyUnstable_Eval_RequestCodeExtraIndex(freefunc free)
291291
292-
Return a new an opaque index value used to adding data to code objects.
292+
Return a new opaque index value used to adding data to code objects.
293293
294294
You generally call this function once (per interpreter) and use the result
295295
with ``PyCode_GetExtra`` and ``PyCode_SetExtra`` to manipulate

Doc/c-api/codec.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Codec registry and support functions
77
88
Register a new codec search function.
99
10-
As side effect, this tries to load the :mod:`!encodings` package, if not yet
10+
As a side effect, this tries to load the :mod:`!encodings` package, if not yet
1111
done, to make sure that it is always first in the list of search functions.
1212
1313
.. c:function:: int PyCodec_Unregister(PyObject *search_function)
@@ -39,7 +39,7 @@ Codec registry and support functions
3939
*object* is passed through the decoder function found for the given
4040
*encoding* using the error handling method defined by *errors*. *errors* may
4141
be ``NULL`` to use the default method defined for the codec. Raises a
42-
:exc:`LookupError` if no encoder can be found.
42+
:exc:`LookupError` if no decoder can be found.
4343
4444
4545
Codec lookup API

Doc/c-api/init.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2140,7 +2140,7 @@ use a thread key and functions to associate a :c:expr:`void*` value per
21402140
thread.
21412141
21422142
A :term:`thread state` does *not* need to be :term:`attached <attached thread state>`
2143-
when calling these functions; they suppl their own locking.
2143+
when calling these functions; they supply their own locking.
21442144
21452145
Note that :file:`Python.h` does not include the declaration of the TLS APIs,
21462146
you need to include :file:`pythread.h` to use thread-local storage.

Doc/deprecations/pending-removal-in-3.20.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Pending removal in Python 3.20
88
- :mod:`argparse`
99
- :mod:`csv`
1010
- :mod:`!ctypes.macholib`
11+
- :mod:`decimal` (use :data:`decimal.SPEC_VERSION` instead)
1112
- :mod:`imaplib`
1213
- :mod:`ipaddress`
1314
- :mod:`json`

Doc/library/concurrent.futures.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,8 @@ ThreadPoolExecutor Example
239239
InterpreterPoolExecutor
240240
-----------------------
241241

242+
.. versionadded:: 3.14
243+
242244
The :class:`InterpreterPoolExecutor` class uses a pool of interpreters
243245
to execute calls asynchronously. It is a :class:`ThreadPoolExecutor`
244246
subclass, which means each worker is running in its own thread.

Doc/library/decimal.rst

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1569,7 +1569,16 @@ In addition to the three supplied contexts, new contexts can be created with the
15691569
Constants
15701570
---------
15711571

1572-
The constants in this section are only relevant for the C module. They
1572+
.. data:: SPEC_VERSION
1573+
1574+
The highest version of the General Decimal Arithmetic
1575+
Specification that this implementation complies with.
1576+
See https://speleotrove.com/decimal/decarith.html for the specification.
1577+
1578+
.. versionadded:: next
1579+
1580+
1581+
The following constants are only relevant for the C module. They
15731582
are also included in the pure Python version for compatibility.
15741583

15751584
+---------------------------------+---------------------+-------------------------------+

Doc/whatsnew/3.15.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -851,6 +851,7 @@ New deprecations
851851
- :mod:`argparse`
852852
- :mod:`csv`
853853
- :mod:`!ctypes.macholib`
854+
- :mod:`decimal` (use :data:`decimal.SPEC_VERSION` instead)
854855
- :mod:`imaplib`
855856
- :mod:`ipaddress`
856857
- :mod:`json`

Grammar/python.gram

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1416,11 +1416,11 @@ invalid_import:
14161416
| 'import' token=NEWLINE {
14171417
RAISE_SYNTAX_ERROR_STARTING_FROM(token, "Expected one or more names after 'import'") }
14181418
invalid_dotted_as_name:
1419-
| dotted_name 'as' !(NAME (',' | ')' | NEWLINE)) a=expression {
1419+
| dotted_name 'as' !(NAME (',' | ')' | ';' | NEWLINE)) a=expression {
14201420
RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a,
14211421
"cannot use %s as import target", _PyPegen_get_expr_name(a)) }
14221422
invalid_import_from_as_name:
1423-
| NAME 'as' !(NAME (',' | ')' | NEWLINE)) a=expression {
1423+
| NAME 'as' !(NAME (',' | ')' | ';' | NEWLINE)) a=expression {
14241424
RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a,
14251425
"cannot use %s as import target", _PyPegen_get_expr_name(a)) }
14261426

Include/internal/pycore_freelist.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,16 @@ extern "C" {
1717
static inline struct _Py_freelists *
1818
_Py_freelists_GET(void)
1919
{
20-
PyThreadState *tstate = _PyThreadState_GET();
2120
#ifdef Py_DEBUG
22-
_Py_EnsureTstateNotNULL(tstate);
21+
_Py_AssertHoldsTstate();
2322
#endif
2423

2524
#ifdef Py_GIL_DISABLED
25+
PyThreadState *tstate = _PyThreadState_GET();
2626
return &((_PyThreadStateImpl*)tstate)->freelists;
2727
#else
28-
return &tstate->interp->object_state.freelists;
28+
PyInterpreterState *interp = _PyInterpreterState_GET();
29+
return &interp->object_state.freelists;
2930
#endif
3031
}
3132

0 commit comments

Comments
 (0)