diff --git a/Doc/whatsnew/3.14.rst b/Doc/whatsnew/3.14.rst
index b174333760e76ae..677365c2f5994b2 100644
--- a/Doc/whatsnew/3.14.rst
+++ b/Doc/whatsnew/3.14.rst
@@ -217,7 +217,7 @@ has significant benefits:
* they support a new (to Python), human-friendly concurrency model
* true multi-core parallelism
-For some use cases, concurrency in software enables efficiency and
+For some use cases, concurrency in software improves efficiency and
can simplify design, at a high level.
At the same time, implementing and maintaining all but the simplest concurrency
is often a struggle for the human brain.
@@ -225,9 +225,10 @@ That especially applies to plain threads (for example, :mod:`threading`),
where all memory is shared between all threads.
With multiple isolated interpreters, you can take advantage of a class
-of concurrency models, like CSP or the actor model, that have found
+of concurrency models, like Communicating Sequential Processes (CSP)
+or the actor model, that have found
success in other programming languages, like Smalltalk, Erlang,
-Haskell, and Go. Think of multiple interpreters like threads
+Haskell, and Go. Think of multiple interpreters as threads
but with opt-in sharing.
Regarding multi-core parallelism: as of Python 3.12, interpreters
@@ -249,8 +250,8 @@ having the isolation of processes with the efficiency of threads.
While the feature has been around for decades, multiple interpreters
have not been used widely, due to low awareness and the lack of a
standard library module. Consequently, they currently have several
-notable limitations, which will improve significantly now that the
-feature is finally going mainstream.
+notable limitations, which are expected to improve significantly now
+that the feature is going mainstream.
Current limitations:
@@ -449,8 +450,8 @@ depending on platform and architecture.
The baseline is Python 3.14 built with Clang 19, without this new interpreter.
This interpreter currently only works with Clang 19 and newer
-on x86-64 and AArch64 architectures. However, a future release
-of GCC is expected will support this as well.
+on x86-64 and AArch64 architectures.
+However, a future release of GCC is expected to support this as well.
This feature is opt-in for now. Enabling profile-guided optimization is highly
recommendeded when using the new interpreter as it is the only configuration
diff --git a/Include/Python.h b/Include/Python.h
index 261b4d316bdf858..78083bbf31db751 100644
--- a/Include/Python.h
+++ b/Include/Python.h
@@ -78,7 +78,7 @@ __pragma(warning(disable: 4201))
#include "pybuffer.h"
#include "pystats.h"
#include "pyatomic.h"
-#include "pylock.h"
+#include "cpython/pylock.h"
#include "critical_section.h"
#include "object.h"
#include "refcount.h"
@@ -105,7 +105,7 @@ __pragma(warning(disable: 4201))
#include "setobject.h"
#include "methodobject.h"
#include "moduleobject.h"
-#include "monitoring.h"
+#include "cpython/monitoring.h"
#include "cpython/funcobject.h"
#include "cpython/classobject.h"
#include "fileobject.h"
diff --git a/Include/cpython/marshal.h b/Include/cpython/marshal.h
new file mode 100644
index 000000000000000..6c1f7f96b6a2e81
--- /dev/null
+++ b/Include/cpython/marshal.h
@@ -0,0 +1,17 @@
+#ifndef _Py_CPYTHON_MARSHAL_H
+# error "this header file must not be included directly"
+#endif
+
+PyAPI_FUNC(PyObject *) PyMarshal_ReadObjectFromString(const char *,
+ Py_ssize_t);
+PyAPI_FUNC(PyObject *) PyMarshal_WriteObjectToString(PyObject *, int);
+
+#define Py_MARSHAL_VERSION 5
+
+PyAPI_FUNC(long) PyMarshal_ReadLongFromFile(FILE *);
+PyAPI_FUNC(int) PyMarshal_ReadShortFromFile(FILE *);
+PyAPI_FUNC(PyObject *) PyMarshal_ReadObjectFromFile(FILE *);
+PyAPI_FUNC(PyObject *) PyMarshal_ReadLastObjectFromFile(FILE *);
+
+PyAPI_FUNC(void) PyMarshal_WriteLongToFile(long, FILE *, int);
+PyAPI_FUNC(void) PyMarshal_WriteObjectToFile(PyObject *, FILE *, int);
diff --git a/Include/cpython/monitoring.h b/Include/cpython/monitoring.h
index ce92942404c9f7d..5094c8c23ae32bb 100644
--- a/Include/cpython/monitoring.h
+++ b/Include/cpython/monitoring.h
@@ -1,7 +1,13 @@
-#ifndef Py_CPYTHON_MONITORING_H
-# error "this header file must not be included directly"
+#ifndef Py_MONITORING_H
+#define Py_MONITORING_H
+#ifndef Py_LIMITED_API
+#ifdef __cplusplus
+extern "C" {
#endif
+// There is currently no limited API for monitoring
+
+
/* Local events.
* These require bytecode instrumentation */
@@ -267,3 +273,9 @@ PyMonitoring_FireStopIterationEvent(PyMonitoringState *state, PyObject *codelike
}
#undef _PYMONITORING_IF_ACTIVE
+
+#ifdef __cplusplus
+}
+#endif
+#endif // !Py_LIMITED_API
+#endif // !Py_MONITORING_H
diff --git a/Include/cpython/pylock.h b/Include/cpython/pylock.h
index 63886fca28eae24..460ac2c9f80e81b 100644
--- a/Include/cpython/pylock.h
+++ b/Include/cpython/pylock.h
@@ -1,7 +1,11 @@
-#ifndef Py_CPYTHON_LOCK_H
-# error "this header file must not be included directly"
+#ifndef Py_LOCK_H
+#define Py_LOCK_H
+#ifndef Py_LIMITED_API
+#ifdef __cplusplus
+extern "C" {
#endif
+
#define _Py_UNLOCKED 0
#define _Py_LOCKED 1
@@ -72,3 +76,10 @@ _PyMutex_IsLocked(PyMutex *m)
return (_Py_atomic_load_uint8(&m->_bits) & _Py_LOCKED) != 0;
}
#define PyMutex_IsLocked _PyMutex_IsLocked
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif // !Py_LIMITED_API
+#endif // !Py_LOCK_H
diff --git a/Include/cpython/sliceobject.h b/Include/cpython/sliceobject.h
new file mode 100644
index 000000000000000..4c3ea1facebc4ed
--- /dev/null
+++ b/Include/cpython/sliceobject.h
@@ -0,0 +1,20 @@
+#ifndef Py_CPYTHON_SLICEOBJECT_H
+# error "this header file must not be included directly"
+#endif
+
+/* Slice object interface */
+
+/*
+A slice object containing start, stop, and step data members (the
+names are from range). After much talk with Guido, it was decided to
+let these be any arbitrary python type. Py_None stands for omitted values.
+*/
+typedef struct {
+ PyObject_HEAD
+ PyObject *start, *stop, *step; /* not NULL */
+} PySliceObject;
+
+PyAPI_FUNC(PyObject *) _PySlice_FromIndices(Py_ssize_t start, Py_ssize_t stop);
+PyAPI_FUNC(int) _PySlice_GetLongIndices(PySliceObject *self, PyObject *length,
+ PyObject **start_ptr, PyObject **stop_ptr,
+ PyObject **step_ptr);
diff --git a/Include/cpython/structseq.h b/Include/cpython/structseq.h
new file mode 100644
index 000000000000000..328fbe86143b024
--- /dev/null
+++ b/Include/cpython/structseq.h
@@ -0,0 +1,12 @@
+#ifndef Py_CPYTHON_STRUCTSEQ_H
+# error "this header file must not be included directly"
+#endif
+
+PyAPI_FUNC(void) PyStructSequence_InitType(PyTypeObject *type,
+ PyStructSequence_Desc *desc);
+PyAPI_FUNC(int) PyStructSequence_InitType2(PyTypeObject *type,
+ PyStructSequence_Desc *desc);
+
+typedef PyTupleObject PyStructSequence;
+#define PyStructSequence_SET_ITEM PyStructSequence_SetItem
+#define PyStructSequence_GET_ITEM PyStructSequence_GetItem
diff --git a/Include/marshal.h b/Include/marshal.h
index f773587bdd0429e..2ccb112b40c7527 100644
--- a/Include/marshal.h
+++ b/Include/marshal.h
@@ -1,31 +1,18 @@
-
/* Interface for marshal.c */
#ifndef Py_MARSHAL_H
#define Py_MARSHAL_H
-#ifndef Py_LIMITED_API
-
#ifdef __cplusplus
extern "C" {
#endif
-PyAPI_FUNC(PyObject *) PyMarshal_ReadObjectFromString(const char *,
- Py_ssize_t);
-PyAPI_FUNC(PyObject *) PyMarshal_WriteObjectToString(PyObject *, int);
-
-#define Py_MARSHAL_VERSION 5
-
-PyAPI_FUNC(long) PyMarshal_ReadLongFromFile(FILE *);
-PyAPI_FUNC(int) PyMarshal_ReadShortFromFile(FILE *);
-PyAPI_FUNC(PyObject *) PyMarshal_ReadObjectFromFile(FILE *);
-PyAPI_FUNC(PyObject *) PyMarshal_ReadLastObjectFromFile(FILE *);
-
-PyAPI_FUNC(void) PyMarshal_WriteLongToFile(long, FILE *, int);
-PyAPI_FUNC(void) PyMarshal_WriteObjectToFile(PyObject *, FILE *, int);
+#ifndef Py_LIMITED_API
+# define _Py_CPYTHON_MARSHAL_H
+# include "cpython/marshal.h"
+# undef _Py_CPYTHON_MARSHAL_H
+#endif
#ifdef __cplusplus
}
#endif
-
-#endif /* Py_LIMITED_API */
#endif /* !Py_MARSHAL_H */
diff --git a/Include/monitoring.h b/Include/monitoring.h
deleted file mode 100644
index 985f7f230e44e3d..000000000000000
--- a/Include/monitoring.h
+++ /dev/null
@@ -1,18 +0,0 @@
-#ifndef Py_MONITORING_H
-#define Py_MONITORING_H
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-// There is currently no limited API for monitoring
-
-#ifndef Py_LIMITED_API
-# define Py_CPYTHON_MONITORING_H
-# include "cpython/monitoring.h"
-# undef Py_CPYTHON_MONITORING_H
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* !Py_MONITORING_H */
diff --git a/Include/pylock.h b/Include/pylock.h
deleted file mode 100644
index 1939ef269d30906..000000000000000
--- a/Include/pylock.h
+++ /dev/null
@@ -1,16 +0,0 @@
-#ifndef Py_LOCK_H
-#define Py_LOCK_H
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef Py_LIMITED_API
-# define Py_CPYTHON_LOCK_H
-# include "cpython/pylock.h"
-# undef Py_CPYTHON_LOCK_H
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* !Py_LOCK_H */
diff --git a/Include/sliceobject.h b/Include/sliceobject.h
index 35e2ea254ca80a4..00c70a6e911b417 100644
--- a/Include/sliceobject.h
+++ b/Include/sliceobject.h
@@ -16,19 +16,6 @@ PyAPI_DATA(PyObject) _Py_EllipsisObject; /* Don't use this directly */
/* Slice object interface */
-/*
-
-A slice object containing start, stop, and step data members (the
-names are from range). After much talk with Guido, it was decided to
-let these be any arbitrary python type. Py_None stands for omitted values.
-*/
-#ifndef Py_LIMITED_API
-typedef struct {
- PyObject_HEAD
- PyObject *start, *stop, *step; /* not NULL */
-} PySliceObject;
-#endif
-
PyAPI_DATA(PyTypeObject) PySlice_Type;
PyAPI_DATA(PyTypeObject) PyEllipsis_Type;
@@ -36,12 +23,6 @@ PyAPI_DATA(PyTypeObject) PyEllipsis_Type;
PyAPI_FUNC(PyObject *) PySlice_New(PyObject* start, PyObject* stop,
PyObject* step);
-#ifndef Py_LIMITED_API
-PyAPI_FUNC(PyObject *) _PySlice_FromIndices(Py_ssize_t start, Py_ssize_t stop);
-PyAPI_FUNC(int) _PySlice_GetLongIndices(PySliceObject *self, PyObject *length,
- PyObject **start_ptr, PyObject **stop_ptr,
- PyObject **step_ptr);
-#endif
PyAPI_FUNC(int) PySlice_GetIndices(PyObject *r, Py_ssize_t length,
Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step);
Py_DEPRECATED(3.7)
@@ -63,6 +44,12 @@ PyAPI_FUNC(Py_ssize_t) PySlice_AdjustIndices(Py_ssize_t length,
Py_ssize_t step);
#endif
+#ifndef Py_LIMITED_API
+# define Py_CPYTHON_SLICEOBJECT_H
+# include "cpython/sliceobject.h"
+# undef Py_CPYTHON_SLICEOBJECT_H
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/Include/structseq.h b/Include/structseq.h
index 29e24fee54e6135..e52d6188030af9d 100644
--- a/Include/structseq.h
+++ b/Include/structseq.h
@@ -21,12 +21,6 @@ typedef struct PyStructSequence_Desc {
PyAPI_DATA(const char * const) PyStructSequence_UnnamedField;
-#ifndef Py_LIMITED_API
-PyAPI_FUNC(void) PyStructSequence_InitType(PyTypeObject *type,
- PyStructSequence_Desc *desc);
-PyAPI_FUNC(int) PyStructSequence_InitType2(PyTypeObject *type,
- PyStructSequence_Desc *desc);
-#endif
PyAPI_FUNC(PyTypeObject*) PyStructSequence_NewType(PyStructSequence_Desc *desc);
PyAPI_FUNC(PyObject *) PyStructSequence_New(PyTypeObject* type);
@@ -35,9 +29,9 @@ PyAPI_FUNC(void) PyStructSequence_SetItem(PyObject*, Py_ssize_t, PyObject*);
PyAPI_FUNC(PyObject*) PyStructSequence_GetItem(PyObject*, Py_ssize_t);
#ifndef Py_LIMITED_API
-typedef PyTupleObject PyStructSequence;
-#define PyStructSequence_SET_ITEM PyStructSequence_SetItem
-#define PyStructSequence_GET_ITEM PyStructSequence_GetItem
+# define Py_CPYTHON_STRUCTSEQ_H
+# include "cpython/structseq.h"
+# undef Py_CPYTHON_STRUCTSEQ_H
#endif
#ifdef __cplusplus
diff --git a/Makefile.pre.in b/Makefile.pre.in
index 244e25c348f5a4b..987d55a9bdbd3b5 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -1191,14 +1191,12 @@ PYTHON_HEADERS= \
$(srcdir)/Include/intrcheck.h \
$(srcdir)/Include/iterobject.h \
$(srcdir)/Include/listobject.h \
- $(srcdir)/Include/pylock.h \
$(srcdir)/Include/longobject.h \
$(srcdir)/Include/marshal.h \
$(srcdir)/Include/memoryobject.h \
$(srcdir)/Include/methodobject.h \
$(srcdir)/Include/modsupport.h \
$(srcdir)/Include/moduleobject.h \
- $(srcdir)/Include/monitoring.h \
$(srcdir)/Include/object.h \
$(srcdir)/Include/objimpl.h \
$(srcdir)/Include/opcode.h \
@@ -1271,6 +1269,7 @@ PYTHON_HEADERS= \
$(srcdir)/Include/cpython/pylock.h \
$(srcdir)/Include/cpython/longintrepr.h \
$(srcdir)/Include/cpython/longobject.h \
+ $(srcdir)/Include/cpython/marshal.h \
$(srcdir)/Include/cpython/memoryobject.h \
$(srcdir)/Include/cpython/methodobject.h \
$(srcdir)/Include/cpython/modsupport.h \
@@ -1296,6 +1295,8 @@ PYTHON_HEADERS= \
$(srcdir)/Include/cpython/pythonrun.h \
$(srcdir)/Include/cpython/pythread.h \
$(srcdir)/Include/cpython/setobject.h \
+ $(srcdir)/Include/cpython/sliceobject.h \
+ $(srcdir)/Include/cpython/structseq.h \
$(srcdir)/Include/cpython/traceback.h \
$(srcdir)/Include/cpython/tracemalloc.h \
$(srcdir)/Include/cpython/tupleobject.h \
diff --git a/Modules/_testcapi/monitoring.c b/Modules/_testcapi/monitoring.c
index e041943492d61fe..3f99836c1ebd83b 100644
--- a/Modules/_testcapi/monitoring.c
+++ b/Modules/_testcapi/monitoring.c
@@ -1,8 +1,6 @@
#include "parts.h"
#include "util.h"
-#include "monitoring.h"
-
#define Py_BUILD_CORE
#include "internal/pycore_instruments.h"
diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj
index d7544d3a9fb1225..71f508a7e8b5fbd 100644
--- a/PCbuild/pythoncore.vcxproj
+++ b/PCbuild/pythoncore.vcxproj
@@ -168,9 +168,11 @@
+
+
@@ -190,6 +192,8 @@
+
+
@@ -332,7 +336,6 @@
-
diff --git a/PCbuild/pythoncore.vcxproj.filters b/PCbuild/pythoncore.vcxproj.filters
index 1868b222f185348..547e9ee1abf3704 100644
--- a/PCbuild/pythoncore.vcxproj.filters
+++ b/PCbuild/pythoncore.vcxproj.filters
@@ -120,9 +120,6 @@
Include
-
- Include
-
Include
@@ -489,9 +486,15 @@
Include\cpython
+
+ Include\cpython
+
Include\cpython
+
+ Include\cpython
+
Include\cpython