summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael W. Hudson <mwh@python.net>2002-06-14 13:53:29 (GMT)
committerMichael W. Hudson <mwh@python.net>2002-06-14 13:53:29 (GMT)
commitcb4d7ce7cb2baacd458f7d02e9c12a7aebb828a9 (patch)
treea370dc6fc1e8d0217d9b49826bf26acf2d7d30a2
parent2aabac8276751c6a1a9758a410b8b837354967b8 (diff)
downloadcpython-cb4d7ce7cb2baacd458f7d02e9c12a7aebb828a9.zip
cpython-cb4d7ce7cb2baacd458f7d02e9c12a7aebb828a9.tar.gz
cpython-cb4d7ce7cb2baacd458f7d02e9c12a7aebb828a9.tar.bz2
Now FOR_LOOP is gone, loop_subscript can go too.
make -s rules :-)
-rw-r--r--Python/ceval.c19
1 files changed, 0 insertions, 19 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index 12397b4..7f7d37e 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -51,7 +51,6 @@ static int call_trace(Py_tracefunc, PyObject *, PyFrameObject *,
static void call_trace_protected(Py_tracefunc, PyObject *,
PyFrameObject *, int);
static void call_exc_trace(Py_tracefunc, PyObject *, PyFrameObject *);
-static PyObject *loop_subscript(PyObject *, PyObject *);
static PyObject *apply_slice(PyObject *, PyObject *, PyObject *);
static int assign_slice(PyObject *, PyObject *,
PyObject *, PyObject *);
@@ -3303,24 +3302,6 @@ ext_do_call(PyObject *func, PyObject ***pp_stack, int flags, int na, int nk)
#define SLICE_ERROR_MSG \
"standard sequence type does not support step size other than one"
-static PyObject *
-loop_subscript(PyObject *v, PyObject *w)
-{
- PySequenceMethods *sq = v->ob_type->tp_as_sequence;
- int i;
- if (sq == NULL || sq->sq_item == NULL) {
- PyErr_SetString(PyExc_TypeError, "loop over non-sequence");
- return NULL;
- }
- i = PyInt_AsLong(w);
- v = (*sq->sq_item)(v, i);
- if (v)
- return v;
- if (PyErr_ExceptionMatches(PyExc_IndexError))
- PyErr_Clear();
- return NULL;
-}
-
/* Extract a slice index from a PyInt or PyLong, and store in *pi.
Silently reduce values larger than INT_MAX to INT_MAX, and silently
boost values less than -INT_MAX to 0. Return 0 on error, 1 on success.