diff options
author | Guido van Rossum <guido@python.org> | 2007-09-25 21:51:12 +0000 |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2007-09-25 21:51:12 +0000 |
commit | e4c4837aa5d593c146d2c6a287b99fa5efed926e (patch) | |
tree | 9cd18fac39da8fbdd99d39585e5a1a72fc973143 /Modules/_ctypes | |
parent | 306152bead1d13833ac1c78dd6d2ebd4a25b5b6a (diff) | |
download | cpython-e4c4837aa5d593c146d2c6a287b99fa5efed926e.tar.gz |
Delete now-unused static function Array_ass_slice().
Diffstat (limited to 'Modules/_ctypes')
-rw-r--r-- | Modules/_ctypes/_ctypes.c | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c index 67514c03d3..e24a3283ed 100644 --- a/Modules/_ctypes/_ctypes.c +++ b/Modules/_ctypes/_ctypes.c @@ -3833,48 +3833,6 @@ Array_ass_item(PyObject *_self, Py_ssize_t index, PyObject *value) } static int -Array_ass_slice(PyObject *_self, Py_ssize_t ilow, Py_ssize_t ihigh, PyObject *value) -{ - CDataObject *self = (CDataObject *)_self; - Py_ssize_t i, len; - - if (value == NULL) { - PyErr_SetString(PyExc_TypeError, - "Array does not support item deletion"); - return -1; - } - - if (ilow < 0) - ilow = 0; - else if (ilow > self->b_length) - ilow = self->b_length; - if (ihigh < 0) - ihigh = 0; - if (ihigh < ilow) - ihigh = ilow; - else if (ihigh > self->b_length) - ihigh = self->b_length; - - len = PySequence_Length(value); - if (len != ihigh - ilow) { - PyErr_SetString(PyExc_ValueError, - "Can only assign sequence of same size"); - return -1; - } - for (i = 0; i < len; i++) { - PyObject *item = PySequence_GetItem(value, i); - int result; - if (item == NULL) - return -1; - result = Array_ass_item(_self, i+ilow, item); - Py_DECREF(item); - if (result == -1) - return -1; - } - return 0; -} - -static int Array_ass_subscript(PyObject *_self, PyObject *item, PyObject *value) { CDataObject *self = (CDataObject *)_self; |