Patch #427190: Implement and use METH_NOARGS and METH_O.

This commit is contained in:
Martin v. Löwis 2001-08-16 13:15:00 +00:00
parent c35422109b
commit e3eb1f2b23
17 changed files with 429 additions and 551 deletions

View file

@ -580,18 +580,16 @@ complex_float(PyObject *v)
}
static PyObject *
complex_conjugate(PyObject *self, PyObject *args)
complex_conjugate(PyObject *self)
{
Py_complex c;
if (!PyArg_ParseTuple(args, ":conjugate"))
return NULL;
c = ((PyComplexObject *)self)->cval;
c.imag = -c.imag;
return PyComplex_FromCComplex(c);
}
static PyMethodDef complex_methods[] = {
{"conjugate", complex_conjugate, 1},
{"conjugate", (PyCFunction)complex_conjugate, METH_NOARGS},
{NULL, NULL} /* sentinel */
};