]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Merged revisions 72202 via svnmerge from
authorMark Dickinson <dickinsm@gmail.com>
Sat, 2 May 2009 17:57:52 +0000 (17:57 +0000)
committerMark Dickinson <dickinsm@gmail.com>
Sat, 2 May 2009 17:57:52 +0000 (17:57 +0000)
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r72202 | mark.dickinson | 2009-05-02 18:55:01 +0100 (Sat, 02 May 2009) | 3 lines

  Remove unnecessary use of context for long getters.
  (Related to issue #5880).
........

Objects/longobject.c

index af8c14a13457b1e1b5d1cf0cd622fd7bf514bcaa..b83cdc8ed64d18d47d5782d1d7294813d967e695 100644 (file)
@@ -3832,8 +3832,13 @@ long_getnewargs(PyLongObject *v)
 }
 
 static PyObject *
-long_getN(PyLongObject *v, void *context) {
-       return PyLong_FromLong((Py_intptr_t)context);
+long_get0(PyLongObject *v, void *context) {
+       return PyLong_FromLong(0L);
+}
+
+static PyObject *
+long_get1(PyLongObject *v, void *context) {
+       return PyLong_FromLong(1L);
 }
 
 static PyObject *
@@ -4091,22 +4096,22 @@ static PyMethodDef long_methods[] = {
 };
 
 static PyGetSetDef long_getset[] = {
-    {"real", 
+    {"real",
      (getter)long_long, (setter)NULL,
      "the real part of a complex number",
      NULL},
-    {"imag", 
-     (getter)long_getN, (setter)NULL,
+    {"imag",
+     (getter)long_get0, (setter)NULL,
      "the imaginary part of a complex number",
-     (void*)0},
-    {"numerator", 
+     NULL},
+    {"numerator",
      (getter)long_long, (setter)NULL,
      "the numerator of a rational number in lowest terms",
      NULL},
-    {"denominator", 
-     (getter)long_getN, (setter)NULL,
+    {"denominator",
+     (getter)long_get1, (setter)NULL,
      "the denominator of a rational number in lowest terms",
-     (void*)1},
+     NULL},
     {NULL}  /* Sentinel */
 };