summaryrefslogtreecommitdiffstats
path: root/Objects/complexobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/complexobject.c')
-rw-r--r--Objects/complexobject.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/Objects/complexobject.c b/Objects/complexobject.c
index 56638d5..201da4d 100644
--- a/Objects/complexobject.c
+++ b/Objects/complexobject.c
@@ -639,8 +639,15 @@ complex_conjugate(PyObject *self)
return PyComplex_FromCComplex(c);
}
+static PyObject *
+complex_getnewargs(PyComplexObject *v)
+{
+ return Py_BuildValue("(D)", v->cval);
+}
+
static PyMethodDef complex_methods[] = {
{"conjugate", (PyCFunction)complex_conjugate, METH_NOARGS},
+ {"__getnewargs__", (PyCFunction)complex_getnewargs, METH_NOARGS},
{NULL, NULL} /* sentinel */
};