summaryrefslogtreecommitdiff
path: root/Objects/complexobject.c
diff options
context:
space:
mode:
authorMark Dickinson <dickinsm@gmail.com>2010-08-04 20:56:28 +0000
committerMark Dickinson <dickinsm@gmail.com>2010-08-04 20:56:28 +0000
commit1aad0f038d6c685f874c66c65ea0e4a8f9cf0dab (patch)
tree3b973d86eda529e77cf01b405705df1002b24652 /Objects/complexobject.c
parent4065ddd21813b835ae612c8df2d599d3fa143481 (diff)
downloadcpython-1aad0f038d6c685f874c66c65ea0e4a8f9cf0dab.tar.gz
Issue #9337: Make float.__str__ identical to float.__repr__.
(And similarly for complex numbers.)
Diffstat (limited to 'Objects/complexobject.c')
-rw-r--r--Objects/complexobject.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/Objects/complexobject.c b/Objects/complexobject.c
index 7594c886ec..674362f9eb 100644
--- a/Objects/complexobject.c
+++ b/Objects/complexobject.c
@@ -394,12 +394,6 @@ complex_repr(PyComplexObject *v)
return complex_format(v, 0, 'r');
}
-static PyObject *
-complex_str(PyComplexObject *v)
-{
- return complex_format(v, PyFloat_STR_PRECISION, 'g');
-}
-
static long
complex_hash(PyComplexObject *v)
{
@@ -1104,7 +1098,7 @@ PyTypeObject PyComplex_Type = {
0, /* tp_as_mapping */
(hashfunc)complex_hash, /* tp_hash */
0, /* tp_call */
- (reprfunc)complex_str, /* tp_str */
+ (reprfunc)complex_repr, /* tp_str */
PyObject_GenericGetAttr, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */