diff options
author | Mark Dickinson <dickinsm@gmail.com> | 2009-05-02 17:57:52 (GMT) |
---|---|---|
committer | Mark Dickinson <dickinsm@gmail.com> | 2009-05-02 17:57:52 (GMT) |
commit | 6bf1900e18e57bc43824a229eadc95c98e016fa5 (patch) | |
tree | 224965527962db9c2bec7a1b1faa8cbe79e8895e /Objects | |
parent | 3427846b68916617767c7c764ac98020fffc8aa1 (diff) | |
download | cpython-6bf1900e18e57bc43824a229eadc95c98e016fa5.zip cpython-6bf1900e18e57bc43824a229eadc95c98e016fa5.tar.gz cpython-6bf1900e18e57bc43824a229eadc95c98e016fa5.tar.bz2 |
Merged revisions 72202 via svnmerge from
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).
........
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/longobject.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/Objects/longobject.c b/Objects/longobject.c index af8c14a..b83cdc8 100644 --- a/Objects/longobject.c +++ b/Objects/longobject.c @@ -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 */ }; |