https://github.com/python/cpython/commit/f0e90d78eb115da99e4ce0d1425593f3b71fd975
commit: f0e90d78eb115da99e4ce0d1425593f3b71fd975
branch: main
author: Victor Stinner <[email protected]>
committer: vstinner <[email protected]>
date: 2026-04-30T16:57:29+02:00
summary:
gh-148829: Move sentinelobject.h to Include/cpython/ (#149186)
This C API is not part of the limited C API, so move it to the
CPython C API.
files:
A Include/cpython/sentinelobject.h
D Include/sentinelobject.h
M Include/Python.h
M Makefile.pre.in
M PCbuild/pythoncore.vcxproj
M PCbuild/pythoncore.vcxproj.filters
diff --git a/Include/Python.h b/Include/Python.h
index 1272e2464f91d1..d5e38b8b0201ee 100644
--- a/Include/Python.h
+++ b/Include/Python.h
@@ -117,7 +117,7 @@ __pragma(warning(disable: 4201))
#include "cpython/genobject.h"
#include "descrobject.h"
#include "genericaliasobject.h"
-#include "sentinelobject.h"
+#include "cpython/sentinelobject.h"
#include "warnings.h"
#include "weakrefobject.h"
#include "structseq.h"
diff --git a/Include/sentinelobject.h b/Include/cpython/sentinelobject.h
similarity index 93%
rename from Include/sentinelobject.h
rename to Include/cpython/sentinelobject.h
index 9d8577767b7485..0b6ff0f17e6f8c 100644
--- a/Include/sentinelobject.h
+++ b/Include/cpython/sentinelobject.h
@@ -1,12 +1,12 @@
/* Sentinel object interface */
+#ifndef Py_LIMITED_API
#ifndef Py_SENTINELOBJECT_H
#define Py_SENTINELOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif
-#ifndef Py_LIMITED_API
PyAPI_DATA(PyTypeObject) PySentinel_Type;
#define PySentinel_Check(op) Py_IS_TYPE((op), &PySentinel_Type)
@@ -14,9 +14,9 @@ PyAPI_DATA(PyTypeObject) PySentinel_Type;
PyAPI_FUNC(PyObject *) PySentinel_New(
const char *name,
const char *module_name);
-#endif
#ifdef __cplusplus
}
#endif
#endif /* !Py_SENTINELOBJECT_H */
+#endif /* !Py_LIMITED_API */
diff --git a/Makefile.pre.in b/Makefile.pre.in
index 2ce53c6a816212..0edf55d991a05e 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -1241,7 +1241,6 @@ PYTHON_HEADERS= \
$(srcdir)/Include/pytypedefs.h \
$(srcdir)/Include/rangeobject.h \
$(srcdir)/Include/refcount.h \
- $(srcdir)/Include/sentinelobject.h \
$(srcdir)/Include/setobject.h \
$(srcdir)/Include/sliceobject.h \
$(srcdir)/Include/structmember.h \
@@ -1309,6 +1308,7 @@ PYTHON_HEADERS= \
$(srcdir)/Include/cpython/pystats.h \
$(srcdir)/Include/cpython/pythonrun.h \
$(srcdir)/Include/cpython/pythread.h \
+ $(srcdir)/Include/cpython/sentinelobject.h \
$(srcdir)/Include/cpython/setobject.h \
$(srcdir)/Include/cpython/sliceobject.h \
$(srcdir)/Include/cpython/structseq.h \
diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj
index fb9217fee8bd73..fae4a90b4536fc 100644
--- a/PCbuild/pythoncore.vcxproj
+++ b/PCbuild/pythoncore.vcxproj
@@ -195,6 +195,7 @@
<ClInclude Include="..\Include\cpython\pystats.h" />
<ClInclude Include="..\Include\cpython\pythonrun.h" />
<ClInclude Include="..\Include\cpython\pythread.h" />
+ <ClInclude Include="..\Include\cpython\sentinelobject.h" />
<ClInclude Include="..\Include\cpython\setobject.h" />
<ClInclude Include="..\Include\cpython\sliceobject.h" />
<ClInclude Include="..\Include\cpython\structseq.h" />
@@ -384,7 +385,6 @@
<ClInclude Include="..\Include\pytypedefs.h" />
<ClInclude Include="..\Include\rangeobject.h" />
<ClInclude Include="..\Include\refcount.h" />
- <ClInclude Include="..\Include\sentinelobject.h" />
<ClInclude Include="..\Include\setobject.h" />
<ClInclude Include="..\Include\sliceobject.h" />
<ClInclude Include="..\Include\structmember.h" />
diff --git a/PCbuild/pythoncore.vcxproj.filters
b/PCbuild/pythoncore.vcxproj.filters
index 1e1d085cd75511..04b6641ae30e7f 100644
--- a/PCbuild/pythoncore.vcxproj.filters
+++ b/PCbuild/pythoncore.vcxproj.filters
@@ -222,9 +222,6 @@
<ClInclude Include="..\Include\runtime_structs.h">
<Filter>Include</Filter>
</ClInclude>
- <ClInclude Include="..\Include\sentinelobject.h">
- <Filter>Include</Filter>
- </ClInclude>
<ClInclude Include="..\Include\setobject.h">
<Filter>Include</Filter>
</ClInclude>
@@ -522,6 +519,9 @@
<ClInclude Include="..\Include\cpython\pythread.h">
<Filter>Include\cpython</Filter>
</ClInclude>
+ <ClInclude Include="..\Include\cpython\sentinelobject.h">
+ <Filter>Include</Filter>
+ </ClInclude>
<ClInclude Include="..\Include\cpython\setobject.h">
<Filter>Include\cpython</Filter>
</ClInclude>
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]