]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-120686: remove unused internal c api functions (#120687)
authorIrit Katriel <1055913+iritkatriel@users.noreply.github.com>
Thu, 27 Jun 2024 10:09:30 +0000 (11:09 +0100)
committerGitHub <noreply@github.com>
Thu, 27 Jun 2024 10:09:30 +0000 (11:09 +0100)
Include/internal/pycore_call.h
Include/internal/pycore_dict.h
Include/internal/pycore_identifier.h [deleted file]
Include/internal/pycore_unicodeobject.h
Makefile.pre.in
Objects/object.c
Objects/typeobject.c

index c92028a01299e2d8090b37fe85947678579aca3e..49f5c3322de2671a06f574dc506425fc98f9bcb9 100644 (file)
@@ -8,7 +8,6 @@ extern "C" {
 #  error "this header requires Py_BUILD_CORE define"
 #endif
 
-#include "pycore_identifier.h"    // _Py_Identifier
 #include "pycore_pystate.h"       // _PyThreadState_GET()
 
 /* Suggested size (number of positional arguments) for arrays of PyObject*
index cfe837b1e2b3ab559fd1d8d5f7da5f776efa80b7..9e0e1237915e8277c34311ce09ace473f9160b27 100644 (file)
@@ -9,7 +9,6 @@ extern "C" {
 #endif
 
 #include "pycore_freelist.h"             // _PyFreeListState
-#include "pycore_identifier.h"           // _Py_Identifier
 #include "pycore_object.h"               // PyManagedDictPointer
 #include "pycore_pyatomic_ft_wrappers.h" // FT_ATOMIC_LOAD_SSIZE_ACQUIRE
 
diff --git a/Include/internal/pycore_identifier.h b/Include/internal/pycore_identifier.h
deleted file mode 100644 (file)
index cda2881..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/* String Literals: _Py_Identifier API */
-
-#ifndef Py_INTERNAL_IDENTIFIER_H
-#define Py_INTERNAL_IDENTIFIER_H
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef Py_BUILD_CORE
-#  error "this header requires Py_BUILD_CORE define"
-#endif
-
-extern PyObject* _PyType_LookupId(PyTypeObject *, _Py_Identifier *);
-extern PyObject* _PyObject_LookupSpecialId(PyObject *, _Py_Identifier *);
-extern int _PyObject_SetAttrId(PyObject *, _Py_Identifier *, PyObject *);
-
-#ifdef __cplusplus
-}
-#endif
-#endif  // !Py_INTERNAL_IDENTIFIER_H
index f18a68582b9f01a30a0cf44f8e65bc9da8be1a40..20497ee93016d0690e6aacef4f71ec5231fca756 100644 (file)
@@ -10,7 +10,6 @@ extern "C" {
 
 #include "pycore_lock.h"          // PyMutex
 #include "pycore_fileutils.h"     // _Py_error_handler
-#include "pycore_identifier.h"    // _Py_Identifier
 #include "pycore_ucnhash.h"       // _PyUnicode_Name_CAPI
 #include "pycore_global_objects.h"  // _Py_SINGLETON
 
index da9f39fa0421a62a2dec81753623e541401548fe..41904a2183ae70c2579e1197ffe795de59eb1ec8 100644 (file)
@@ -1178,7 +1178,6 @@ PYTHON_HEADERS= \
                $(srcdir)/Include/internal/pycore_global_strings.h \
                $(srcdir)/Include/internal/pycore_hamt.h \
                $(srcdir)/Include/internal/pycore_hashtable.h \
-               $(srcdir)/Include/internal/pycore_identifier.h \
                $(srcdir)/Include/internal/pycore_import.h \
                $(srcdir)/Include/internal/pycore_importdl.h \
                $(srcdir)/Include/internal/pycore_initconfig.h \
index ce73728aa0417d6518cdc9e32582a72d8489c206..c4622359bb103523ffa4596f006cef091c6ec4b3 100644 (file)
@@ -1124,17 +1124,6 @@ _PyObject_GetAttrId(PyObject *v, _Py_Identifier *name)
     return result;
 }
 
-int
-_PyObject_SetAttrId(PyObject *v, _Py_Identifier *name, PyObject *w)
-{
-    int result;
-    PyObject *oname = _PyUnicode_FromId(name); /* borrowed */
-    if (!oname)
-        return -1;
-    result = PyObject_SetAttr(v, oname, w);
-    return result;
-}
-
 int
 _PyObject_SetAttributeErrorContext(PyObject* v, PyObject* name)
 {
index 51a7adf5c40503553353e6e6e50f907b926ea1bb..d374a8e6393176a94ef4b4f0142951125f9a104e 100644 (file)
@@ -2699,15 +2699,6 @@ _PyObject_LookupSpecialMethod(PyObject *self, PyObject *attr, PyObject **self_or
     return res;
 }
 
-PyObject *
-_PyObject_LookupSpecialId(PyObject *self, _Py_Identifier *attrid)
-{
-    PyObject *attr = _PyUnicode_FromId(attrid);   /* borrowed */
-    if (attr == NULL)
-        return NULL;
-    return _PyObject_LookupSpecial(self, attr);
-}
-
 static PyObject *
 lookup_maybe_method(PyObject *self, PyObject *attr, int *unbound)
 {
@@ -5490,16 +5481,6 @@ _PyType_Lookup(PyTypeObject *type, PyObject *name)
     return res;
 }
 
-PyObject *
-_PyType_LookupId(PyTypeObject *type, _Py_Identifier *name)
-{
-    PyObject *oname;
-    oname = _PyUnicode_FromId(name);   /* borrowed */
-    if (oname == NULL)
-        return NULL;
-    return _PyType_Lookup(type, oname);
-}
-
 static void
 set_flags(PyTypeObject *self, unsigned long mask, unsigned long flags)
 {