mirror of
https://github.com/python/cpython.git
synced 2025-12-04 16:43:27 +00:00
Tabification changes only; the module was already newly named.
This commit is contained in:
parent
b2b44e5b8a
commit
19f61ae196
1 changed files with 36 additions and 31 deletions
|
|
@ -140,44 +140,48 @@ spam3n(op_setitem , PyObject_SetItem)
|
||||||
|
|
||||||
static PyObject*
|
static PyObject*
|
||||||
op_getslice(s,a)
|
op_getslice(s,a)
|
||||||
PyObject *s, *a;
|
PyObject *s, *a;
|
||||||
{
|
{
|
||||||
PyObject *a1;
|
PyObject *a1;
|
||||||
long a2,a3;
|
long a2,a3;
|
||||||
|
|
||||||
if(! PyArg_ParseTuple(a,"Oii",&a1,&a2,&a3)) return NULL;
|
if (!PyArg_ParseTuple(a,"Oii",&a1,&a2,&a3))
|
||||||
|
return NULL;
|
||||||
return PySequence_GetSlice(a1,a2,a3);
|
return PySequence_GetSlice(a1,a2,a3);
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject*
|
static PyObject*
|
||||||
op_setslice(s,a)
|
op_setslice(s,a)
|
||||||
PyObject *s, *a;
|
PyObject *s, *a;
|
||||||
{
|
{
|
||||||
PyObject *a1, *a4;
|
PyObject *a1, *a4;
|
||||||
long a2,a3;
|
long a2,a3;
|
||||||
|
|
||||||
if(! PyArg_ParseTuple(a,"OiiO",&a1,&a2,&a3,&a4)) return NULL;
|
if (!PyArg_ParseTuple(a,"OiiO",&a1,&a2,&a3,&a4))
|
||||||
|
return NULL;
|
||||||
|
|
||||||
if(-1 == PySequence_SetSlice(a1,a2,a3,a4)) return NULL;
|
if (-1 == PySequence_SetSlice(a1,a2,a3,a4))
|
||||||
|
return NULL;
|
||||||
|
|
||||||
Py_INCREF(Py_None);
|
Py_INCREF(Py_None);
|
||||||
return Py_None;
|
return Py_None;
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject*
|
static PyObject*
|
||||||
op_delslice(s,a)
|
op_delslice(s,a)
|
||||||
PyObject *s, *a;
|
PyObject *s, *a;
|
||||||
{
|
{
|
||||||
PyObject *a1;
|
PyObject *a1;
|
||||||
long a2,a3;
|
long a2,a3;
|
||||||
|
|
||||||
if(! PyArg_ParseTuple(a,"Oii",&a1,&a2,&a3)) return NULL;
|
if(! PyArg_ParseTuple(a,"Oii",&a1,&a2,&a3))
|
||||||
|
return NULL;
|
||||||
|
|
||||||
if(-1 == PySequence_DelSlice(a1,a2,a3)) return NULL;
|
if (-1 == PySequence_DelSlice(a1,a2,a3))
|
||||||
|
return NULL;
|
||||||
|
|
||||||
Py_INCREF(Py_None);
|
Py_INCREF(Py_None);
|
||||||
return Py_None;
|
return Py_None;
|
||||||
}
|
}
|
||||||
|
|
||||||
#undef spam1
|
#undef spam1
|
||||||
|
|
@ -252,18 +256,19 @@ spam2(delslice,__delslice__,
|
||||||
void
|
void
|
||||||
initoperator()
|
initoperator()
|
||||||
{
|
{
|
||||||
PyObject *m, *d;
|
PyObject *m, *d;
|
||||||
|
|
||||||
/* Create the module and add the functions */
|
/* Create the module and add the functions */
|
||||||
m = Py_InitModule4("operator", operator_methods,
|
m = Py_InitModule4("operator", operator_methods,
|
||||||
operator_doc,
|
operator_doc,
|
||||||
(PyObject*)NULL,PYTHON_API_VERSION);
|
(PyObject*)NULL,PYTHON_API_VERSION);
|
||||||
|
|
||||||
/* Add some symbolic constants to the module */
|
/* Add some symbolic constants to the module */
|
||||||
d = PyModule_GetDict(m);
|
d = PyModule_GetDict(m);
|
||||||
PyDict_SetItemString(d, "__version__",PyString_FromString("$Rev$"));
|
PyDict_SetItemString(d, "__version__",
|
||||||
|
PyString_FromString("$Rev$"));
|
||||||
|
|
||||||
/* Check for errors */
|
/* Check for errors */
|
||||||
if (PyErr_Occurred())
|
if (PyErr_Occurred())
|
||||||
Py_FatalError("can't initialize module operator");
|
Py_FatalError("can't initialize module operator");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue