Remove unnecessary use of context for long getters.

(Related to issue #5880).
This commit is contained in:
Mark Dickinson 2009-05-02 17:55:01 +00:00
parent bf6c410b2e
commit d4b5c98fa6

View file

@ -3595,8 +3595,13 @@ long_getnewargs(PyLongObject *v)
} }
static PyObject * static PyObject *
long_getN(PyLongObject *v, void *context) { long_get0(PyLongObject *v, void *context) {
return PyLong_FromLong((Py_intptr_t)context); return PyLong_FromLong(0L);
}
static PyObject *
long_get1(PyLongObject *v, void *context) {
return PyLong_FromLong(1L);
} }
static PyObject * static PyObject *
@ -3734,17 +3739,17 @@ static PyGetSetDef long_getset[] = {
"the real part of a complex number", "the real part of a complex number",
NULL}, NULL},
{"imag", {"imag",
(getter)long_getN, (setter)NULL, (getter)long_get0, (setter)NULL,
"the imaginary part of a complex number", "the imaginary part of a complex number",
(void*)0}, NULL},
{"numerator", {"numerator",
(getter)long_long, (setter)NULL, (getter)long_long, (setter)NULL,
"the numerator of a rational number in lowest terms", "the numerator of a rational number in lowest terms",
NULL}, NULL},
{"denominator", {"denominator",
(getter)long_getN, (setter)NULL, (getter)long_get1, (setter)NULL,
"the denominator of a rational number in lowest terms", "the denominator of a rational number in lowest terms",
(void*)1}, NULL},
{NULL} /* Sentinel */ {NULL} /* Sentinel */
}; };