summaryrefslogtreecommitdiffstats
path: root/Objects/methodobject.c
diff options
context:
space:
mode:
authorAmaury Forgeot d'Arc <amauryfa@gmail.com>2008-07-02 21:41:01 (GMT)
committerAmaury Forgeot d'Arc <amauryfa@gmail.com>2008-07-02 21:41:01 (GMT)
commitba4105c1335503e3d441abbd7a3e74d255ead1a5 (patch)
treebc5410e38b50797d7471fcbdbe359787fafc0c04 /Objects/methodobject.c
parente43d33a4db0c0c9afcb70a26f682abfe889e845b (diff)
downloadcpython-ba4105c1335503e3d441abbd7a3e74d255ead1a5.zip
cpython-ba4105c1335503e3d441abbd7a3e74d255ead1a5.tar.gz
cpython-ba4105c1335503e3d441abbd7a3e74d255ead1a5.tar.bz2
#3247: Get rid of Py_FindMethod:
Second step: keep tp_getattr functions when they are complex, but use PyObject_GenericGetAttr() as a fallback. These were the last occurrences of Py_FindMethod.
Diffstat (limited to 'Objects/methodobject.c')
-rw-r--r--Objects/methodobject.c37
1 files changed, 0 insertions, 37 deletions
diff --git a/Objects/methodobject.c b/Objects/methodobject.c
index 3d208c1..cb6f1ba 100644
--- a/Objects/methodobject.c
+++ b/Objects/methodobject.c
@@ -280,43 +280,6 @@ PyTypeObject PyCFunction_Type = {
0, /* tp_dict */
};
-/* Find a method in a method chain */
-
-PyObject *
-Py_FindMethodInChain(PyMethodChain *chain, PyObject *self, const char *name)
-{
- if (name[0] == '_' && name[1] == '_') {
- if (strcmp(name, "__doc__") == 0) {
- const char *doc = self->ob_type->tp_doc;
- if (doc != NULL)
- return PyUnicode_FromString(doc);
- }
- }
- while (chain != NULL) {
- PyMethodDef *ml = chain->methods;
- for (; ml->ml_name != NULL; ml++) {
- if (name[0] == ml->ml_name[0] &&
- strcmp(name+1, ml->ml_name+1) == 0)
- /* XXX */
- return PyCFunction_New(ml, self);
- }
- chain = chain->link;
- }
- PyErr_SetString(PyExc_AttributeError, name);
- return NULL;
-}
-
-/* Find a method in a single method list */
-
-PyObject *
-Py_FindMethod(PyMethodDef *methods, PyObject *self, const char *name)
-{
- PyMethodChain chain;
- chain.methods = methods;
- chain.link = NULL;
- return Py_FindMethodInChain(&chain, self, name);
-}
-
/* Clear out the free list */
int