[Python-checkins] bpo-39372: Clean header files of declared interfaces with no implementations (GH-18037)

Pablo Galindo webhook-mailer at python.org
Fri Jan 17 22:15:06 EST 2020


https://github.com/python/cpython/commit/cd7db76a636c218b2d81d3526eb435cfae61f212
commit: cd7db76a636c218b2d81d3526eb435cfae61f212
branch: master
author: Pablo Galindo <Pablogsal at gmail.com>
committer: GitHub <noreply at github.com>
date: 2020-01-18T03:14:59Z
summary:

bpo-39372: Clean header files of declared interfaces with no implementations (GH-18037)

The public API symbols being removed are:

_PyBytes_InsertThousandsGroupingLocale, _PyBytes_InsertThousandsGrouping, _Py_InitializeFromArgs, _Py_InitializeFromWideArgs, _PyFloat_Repr, _PyFloat_Digits,
_PyFloat_DigitsInit, PyFrame_ExtendStack, _PyAIterWrapper_Type, PyNullImporter_Type, PyCmpWrapper_Type, PySortWrapper_Type, PyNoArgsFunction.

files:
A Misc/NEWS.d/next/C API/2020-01-17-19-25-48.bpo-39372.hGJMY6.rst
M Include/bytesobject.h
M Include/cpython/pylifecycle.h
M Include/floatobject.h
M Include/frameobject.h
M Include/genobject.h
M Include/import.h
M Include/internal/pycore_pathconfig.h
M Include/iterobject.h
M Include/listobject.h
M Include/methodobject.h
M Include/pythread.h
M Objects/stringlib/asciilib.h
M Objects/stringlib/ucs1lib.h
M Objects/stringlib/ucs2lib.h
M Objects/stringlib/ucs4lib.h
M Objects/stringlib/undef.h

diff --git a/Include/bytesobject.h b/Include/bytesobject.h
index fc9981e56d277..4aaa71a832bd7 100644
--- a/Include/bytesobject.h
+++ b/Include/bytesobject.h
@@ -106,28 +106,6 @@ PyAPI_FUNC(int) PyBytes_AsStringAndSize(
                            strings) */
     );
 
-/* Using the current locale, insert the thousands grouping
-   into the string pointed to by buffer.  For the argument descriptions,
-   see Objects/stringlib/localeutil.h */
-#ifndef Py_LIMITED_API
-PyAPI_FUNC(Py_ssize_t) _PyBytes_InsertThousandsGroupingLocale(char *buffer,
-                                                   Py_ssize_t n_buffer,
-                                                   char *digits,
-                                                   Py_ssize_t n_digits,
-                                                   Py_ssize_t min_width);
-
-/* Using explicit passed-in values, insert the thousands grouping
-   into the string pointed to by buffer.  For the argument descriptions,
-   see Objects/stringlib/localeutil.h */
-PyAPI_FUNC(Py_ssize_t) _PyBytes_InsertThousandsGrouping(char *buffer,
-                                                   Py_ssize_t n_buffer,
-                                                   char *digits,
-                                                   Py_ssize_t n_digits,
-                                                   Py_ssize_t min_width,
-                                                   const char *grouping,
-                                                   const char *thousands_sep);
-#endif
-
 /* Flags used by string formatting */
 #define F_LJUST (1<<0)
 #define F_SIGN  (1<<1)
diff --git a/Include/cpython/pylifecycle.h b/Include/cpython/pylifecycle.h
index 2f3a0dbdfe64c..a01e9c94f12d7 100644
--- a/Include/cpython/pylifecycle.h
+++ b/Include/cpython/pylifecycle.h
@@ -32,14 +32,6 @@ PyAPI_FUNC(int) _Py_IsCoreInitialized(void);
 
 PyAPI_FUNC(PyStatus) Py_InitializeFromConfig(
     const PyConfig *config);
-PyAPI_FUNC(PyStatus) _Py_InitializeFromArgs(
-    const PyConfig *config,
-    Py_ssize_t argc,
-    char * const *argv);
-PyAPI_FUNC(PyStatus) _Py_InitializeFromWideArgs(
-    const PyConfig *config,
-    Py_ssize_t argc,
-    wchar_t * const *argv);
 PyAPI_FUNC(PyStatus) _Py_InitializeMain(void);
 
 PyAPI_FUNC(int) Py_RunMain(void);
diff --git a/Include/floatobject.h b/Include/floatobject.h
index f1044d64cba84..0fb9fc4e0fae7 100644
--- a/Include/floatobject.h
+++ b/Include/floatobject.h
@@ -88,15 +88,6 @@ PyAPI_FUNC(int) _PyFloat_Pack2(double x, unsigned char *p, int le);
 PyAPI_FUNC(int) _PyFloat_Pack4(double x, unsigned char *p, int le);
 PyAPI_FUNC(int) _PyFloat_Pack8(double x, unsigned char *p, int le);
 
-/* Needed for the old way for marshal to store a floating point number.
-   Returns the string length copied into p, -1 on error.
- */
-PyAPI_FUNC(int) _PyFloat_Repr(double x, char *p, size_t len);
-
-/* Used to get the important decimal digits of a double */
-PyAPI_FUNC(int) _PyFloat_Digits(char *buf, double v, int *signum);
-PyAPI_FUNC(void) _PyFloat_DigitsInit(void);
-
 /* The unpack routines read 2, 4 or 8 bytes, starting at p.  le is a bool
  * argument, true if the string is in little-endian format (exponent
  * last, at p+1, p+3 or p+7), false if big-endian (exponent first, at p).
diff --git a/Include/frameobject.h b/Include/frameobject.h
index 3bad86a66f752..ddcf1591aaea7 100644
--- a/Include/frameobject.h
+++ b/Include/frameobject.h
@@ -67,10 +67,6 @@ PyFrameObject* _PyFrame_New_NoTrack(PyThreadState *, PyCodeObject *,
 PyAPI_FUNC(void) PyFrame_BlockSetup(PyFrameObject *, int, int, int);
 PyAPI_FUNC(PyTryBlock *) PyFrame_BlockPop(PyFrameObject *);
 
-/* Extend the value stack */
-
-PyAPI_FUNC(PyObject **) PyFrame_ExtendStack(PyFrameObject *, int, int);
-
 /* Conversions between "fast locals" and locals in dictionary */
 
 PyAPI_FUNC(void) PyFrame_LocalsToFast(PyFrameObject *, int);
diff --git a/Include/genobject.h b/Include/genobject.h
index 96f8dcc74d8ce..5ee9a2831d12b 100644
--- a/Include/genobject.h
+++ b/Include/genobject.h
@@ -58,8 +58,6 @@ typedef struct {
 PyAPI_DATA(PyTypeObject) PyCoro_Type;
 PyAPI_DATA(PyTypeObject) _PyCoroWrapper_Type;
 
-PyAPI_DATA(PyTypeObject) _PyAIterWrapper_Type;
-
 #define PyCoro_CheckExact(op) (Py_TYPE(op) == &PyCoro_Type)
 PyObject *_PyCoro_GetAwaitableIter(PyObject *o);
 PyAPI_FUNC(PyObject *) PyCoro_New(struct _frame *,
diff --git a/Include/import.h b/Include/import.h
index 735533ee7a79a..aeef3efd0bcee 100644
--- a/Include/import.h
+++ b/Include/import.h
@@ -81,8 +81,6 @@ PyAPI_FUNC(int) PyImport_ImportFrozenModule(
     const char *name            /* UTF-8 encoded string */
     );
 
-PyAPI_DATA(PyTypeObject) PyNullImporter_Type;
-
 PyAPI_FUNC(int) PyImport_AppendInittab(
     const char *name,           /* ASCII encoded string */
     PyObject* (*initfunc)(void)
diff --git a/Include/internal/pycore_pathconfig.h b/Include/internal/pycore_pathconfig.h
index 257c056a77d0d..42d61b1ca26bd 100644
--- a/Include/internal/pycore_pathconfig.h
+++ b/Include/internal/pycore_pathconfig.h
@@ -47,8 +47,6 @@ PyAPI_DATA(wchar_t*) _Py_dll_path;
 #endif
 
 extern void _PyPathConfig_ClearGlobal(void);
-extern PyStatus _PyPathConfig_SetGlobal(
-    const struct _PyPathConfig *pathconfig);
 
 extern PyStatus _PyPathConfig_Calculate(
     _PyPathConfig *pathconfig,
diff --git a/Include/iterobject.h b/Include/iterobject.h
index f61726f1f7f83..eec2ee271eb67 100644
--- a/Include/iterobject.h
+++ b/Include/iterobject.h
@@ -7,7 +7,6 @@ extern "C" {
 
 PyAPI_DATA(PyTypeObject) PySeqIter_Type;
 PyAPI_DATA(PyTypeObject) PyCallIter_Type;
-PyAPI_DATA(PyTypeObject) PyCmpWrapper_Type;
 
 #define PySeqIter_Check(op) (Py_TYPE(op) == &PySeqIter_Type)
 
diff --git a/Include/listobject.h b/Include/listobject.h
index 6057279d51c3a..baf94152792ed 100644
--- a/Include/listobject.h
+++ b/Include/listobject.h
@@ -43,7 +43,6 @@ typedef struct {
 PyAPI_DATA(PyTypeObject) PyList_Type;
 PyAPI_DATA(PyTypeObject) PyListIter_Type;
 PyAPI_DATA(PyTypeObject) PyListRevIter_Type;
-PyAPI_DATA(PyTypeObject) PySortWrapper_Type;
 
 #define PyList_Check(op) \
     PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_LIST_SUBCLASS)
diff --git a/Include/methodobject.h b/Include/methodobject.h
index a15d05f89917e..d9f8d4f80c2cd 100644
--- a/Include/methodobject.h
+++ b/Include/methodobject.h
@@ -22,8 +22,6 @@ typedef PyObject *(*PyCFunctionWithKeywords)(PyObject *, PyObject *,
 typedef PyObject *(*_PyCFunctionFastWithKeywords) (PyObject *,
                                                    PyObject *const *, Py_ssize_t,
                                                    PyObject *);
-typedef PyObject *(*PyNoArgsFunction)(PyObject *);
-
 PyAPI_FUNC(PyCFunction) PyCFunction_GetFunction(PyObject *);
 PyAPI_FUNC(PyObject *) PyCFunction_GetSelf(PyObject *);
 PyAPI_FUNC(int) PyCFunction_GetFlags(PyObject *);
diff --git a/Include/pythread.h b/Include/pythread.h
index 569d69648994f..1cf83b7a36d14 100644
--- a/Include/pythread.h
+++ b/Include/pythread.h
@@ -3,7 +3,6 @@
 #define Py_PYTHREAD_H
 
 typedef void *PyThread_type_lock;
-typedef void *PyThread_type_sema;
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/Misc/NEWS.d/next/C API/2020-01-17-19-25-48.bpo-39372.hGJMY6.rst b/Misc/NEWS.d/next/C API/2020-01-17-19-25-48.bpo-39372.hGJMY6.rst
new file mode 100644
index 0000000000000..8415d756ffa49
--- /dev/null
+++ b/Misc/NEWS.d/next/C API/2020-01-17-19-25-48.bpo-39372.hGJMY6.rst	
@@ -0,0 +1,8 @@
+Clean header files of interfaces defined but with no implementation. The
+public API symbols being removed are:
+``_PyBytes_InsertThousandsGroupingLocale``,
+``_PyBytes_InsertThousandsGrouping``, ``_Py_InitializeFromArgs``,
+``_Py_InitializeFromWideArgs``, ``_PyFloat_Repr``, ``_PyFloat_Digits``,
+``_PyFloat_DigitsInit``, ``PyFrame_ExtendStack``, ``_PyAIterWrapper_Type``,
+``PyNullImporter_Type``, ``PyCmpWrapper_Type``, ``PySortWrapper_Type``,
+``PyNoArgsFunction``.
diff --git a/Objects/stringlib/asciilib.h b/Objects/stringlib/asciilib.h
index d0fc18d22fa5f..e95552624aa50 100644
--- a/Objects/stringlib/asciilib.h
+++ b/Objects/stringlib/asciilib.h
@@ -24,6 +24,3 @@
 
 #define STRINGLIB_TOSTR          PyObject_Str
 #define STRINGLIB_TOASCII        PyObject_ASCII
-
-#define _Py_InsertThousandsGrouping _PyUnicode_ascii_InsertThousandsGrouping
-
diff --git a/Objects/stringlib/ucs1lib.h b/Objects/stringlib/ucs1lib.h
index ce1eb57f0d7da..bc4b104f112cc 100644
--- a/Objects/stringlib/ucs1lib.h
+++ b/Objects/stringlib/ucs1lib.h
@@ -24,7 +24,3 @@
 
 #define STRINGLIB_TOSTR          PyObject_Str
 #define STRINGLIB_TOASCII        PyObject_ASCII
-
-#define _Py_InsertThousandsGrouping _PyUnicode_ucs1_InsertThousandsGrouping
-
-
diff --git a/Objects/stringlib/ucs2lib.h b/Objects/stringlib/ucs2lib.h
index f900cb65f8ced..86a1dff1b5637 100644
--- a/Objects/stringlib/ucs2lib.h
+++ b/Objects/stringlib/ucs2lib.h
@@ -24,6 +24,3 @@
 
 #define STRINGLIB_TOSTR          PyObject_Str
 #define STRINGLIB_TOASCII        PyObject_ASCII
-
-#define _Py_InsertThousandsGrouping _PyUnicode_ucs2_InsertThousandsGrouping
-
diff --git a/Objects/stringlib/ucs4lib.h b/Objects/stringlib/ucs4lib.h
index 86a480f1e3a7e..3c32a93c96a1c 100644
--- a/Objects/stringlib/ucs4lib.h
+++ b/Objects/stringlib/ucs4lib.h
@@ -25,5 +25,3 @@
 #define STRINGLIB_TOSTR          PyObject_Str
 #define STRINGLIB_TOASCII        PyObject_ASCII
 
-#define _Py_InsertThousandsGrouping _PyUnicode_ucs4_InsertThousandsGrouping
-
diff --git a/Objects/stringlib/undef.h b/Objects/stringlib/undef.h
index f9d3f1d3328d5..c41e254fde6f4 100644
--- a/Objects/stringlib/undef.h
+++ b/Objects/stringlib/undef.h
@@ -6,6 +6,5 @@
 #undef  STRINGLIB_STR
 #undef  STRINGLIB_LEN
 #undef  STRINGLIB_NEW
-#undef  _Py_InsertThousandsGrouping
 #undef STRINGLIB_IS_UNICODE
 



More information about the Python-checkins mailing list