summaryrefslogtreecommitdiffstats
path: root/Python/structmember.c
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2007-08-11 06:39:53 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2007-08-11 06:39:53 (GMT)
commit8dfc4a9baca7b039048b6e1dab3e4eb09f7af463 (patch)
treec755a631b7c3736811c173469a63d570124fe0d4 /Python/structmember.c
parent32ca442b13ecbd50e9b4a55b97ca12061ef13b5f (diff)
downloadcpython-8dfc4a9baca7b039048b6e1dab3e4eb09f7af463.zip
cpython-8dfc4a9baca7b039048b6e1dab3e4eb09f7af463.tar.gz
cpython-8dfc4a9baca7b039048b6e1dab3e4eb09f7af463.tar.bz2
Remove support for __members__ and __methods__. There still might be
some cleanup to do on this. Particularly in Python/traceback.c with getting rid of the getattr if possible and Demo/*metaclasses/Enum.py.
Diffstat (limited to 'Python/structmember.c')
-rw-r--r--Python/structmember.c66
1 files changed, 0 insertions, 66 deletions
diff --git a/Python/structmember.c b/Python/structmember.c
index 041f29b..e0014c4 100644
--- a/Python/structmember.c
+++ b/Python/structmember.c
@@ -5,51 +5,6 @@
#include "structmember.h"
-static PyObject *
-listmembers(struct memberlist *mlist)
-{
- int i, n;
- PyObject *v;
- for (n = 0; mlist[n].name != NULL; n++)
- ;
- v = PyList_New(n);
- if (v != NULL) {
- for (i = 0; i < n; i++)
- PyList_SetItem(v, i,
- PyString_FromString(mlist[i].name));
- if (PyErr_Occurred()) {
- Py_DECREF(v);
- v = NULL;
- }
- else {
- PyList_Sort(v);
- }
- }
- return v;
-}
-
-PyObject *
-PyMember_Get(const char *addr, struct memberlist *mlist, const char *name)
-{
- struct memberlist *l;
-
- if (strcmp(name, "__members__") == 0)
- return listmembers(mlist);
- for (l = mlist; l->name != NULL; l++) {
- if (strcmp(l->name, name) == 0) {
- PyMemberDef copy;
- copy.name = l->name;
- copy.type = l->type;
- copy.offset = l->offset;
- copy.flags = l->flags;
- copy.doc = NULL;
- return PyMember_GetOne(addr, &copy);
- }
- }
- PyErr_SetString(PyExc_AttributeError, name);
- return NULL;
-}
-
PyObject *
PyMember_GetOne(const char *addr, PyMemberDef *l)
{
@@ -135,27 +90,6 @@ PyMember_GetOne(const char *addr, PyMemberDef *l)
return v;
}
-int
-PyMember_Set(char *addr, struct memberlist *mlist, const char *name, PyObject *v)
-{
- struct memberlist *l;
-
- for (l = mlist; l->name != NULL; l++) {
- if (strcmp(l->name, name) == 0) {
- PyMemberDef copy;
- copy.name = l->name;
- copy.type = l->type;
- copy.offset = l->offset;
- copy.flags = l->flags;
- copy.doc = NULL;
- return PyMember_SetOne(addr, &copy, v);
- }
- }
-
- PyErr_SetString(PyExc_AttributeError, name);
- return -1;
-}
-
#define WARN(msg) \
do { \
if (PyErr_Warn(PyExc_RuntimeWarning, msg) < 0) \