mirror of
https://github.com/python/cpython.git
synced 2026-01-06 15:32:22 +00:00
Add check to conjugate() that there are no excess arguments.
This commit is contained in:
parent
dda6696be6
commit
8530ef625a
1 changed files with 5 additions and 2 deletions
|
|
@ -573,17 +573,20 @@ complex_float(v)
|
|||
}
|
||||
|
||||
static PyObject *
|
||||
complex_conjugate(self)
|
||||
complex_conjugate(self, args)
|
||||
PyObject *self;
|
||||
PyObject *args;
|
||||
{
|
||||
Py_complex c;
|
||||
if (!PyArg_ParseTuple(args, ""))
|
||||
return NULL;
|
||||
c = ((PyComplexObject *)self)->cval;
|
||||
c.imag = -c.imag;
|
||||
return PyComplex_FromCComplex(c);
|
||||
}
|
||||
|
||||
static PyMethodDef complex_methods[] = {
|
||||
{"conjugate", (PyCFunction)complex_conjugate, 1},
|
||||
{"conjugate", complex_conjugate, 1},
|
||||
{NULL, NULL} /* sentinel */
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue