summaryrefslogtreecommitdiffstats
path: root/Objects/longobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/longobject.c')
-rw-r--r--Objects/longobject.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/Objects/longobject.c b/Objects/longobject.c
index 1180ec2..7a04f1e 100644
--- a/Objects/longobject.c
+++ b/Objects/longobject.c
@@ -2646,6 +2646,17 @@ long_subtype_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
return (PyObject *)new;
}
+static PyObject *
+long_getnewargs(PyLongObject *v)
+{
+ return Py_BuildValue("(N)", _PyLong_Copy(v));
+}
+
+static PyMethodDef long_methods[] = {
+ {"__getnewargs__", (PyCFunction)long_getnewargs, METH_NOARGS},
+ {NULL, NULL} /* sentinel */
+};
+
PyDoc_STRVAR(long_doc,
"long(x[, base]) -> integer\n\
\n\
@@ -2726,7 +2737,7 @@ PyTypeObject PyLong_Type = {
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
- 0, /* tp_methods */
+ long_methods, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
0, /* tp_base */