Skip to content

Commit

Permalink
gh-120686: remove unused internal c api functions (#120687)
Browse files Browse the repository at this point in the history
  • Loading branch information
iritkatriel authored Jun 27, 2024
1 parent 12af8ec commit 6f7acaa
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 54 deletions.
1 change: 0 additions & 1 deletion Include/internal/pycore_call.h
Original file line number Diff line number Diff line change
Expand Up @@ -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*
Expand Down
1 change: 0 additions & 1 deletion Include/internal/pycore_dict.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
20 changes: 0 additions & 20 deletions Include/internal/pycore_identifier.h

This file was deleted.

1 change: 0 additions & 1 deletion Include/internal/pycore_unicodeobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 0 additions & 1 deletion Makefile.pre.in
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
11 changes: 0 additions & 11 deletions Objects/object.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
19 changes: 0 additions & 19 deletions Objects/typeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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)
{
Expand Down

0 comments on commit 6f7acaa

Please sign in to comment.