diff Objects/complexobject.c @ 63750:eafe07d40eb7

Issue #9337: Make float.__str__ identical to float.__repr__. (And similarly for complex numbers.)
author Mark Dickinson <dickinsm@gmail.com>
date Wed, 04 Aug 2010 20:56:28 +0000
parents 0bc8ffe6ba9a
children e8969fb822fc
line wrap: on
line diff
--- a/Objects/complexobject.c	Wed Aug 04 19:08:20 2010 +0000
+++ b/Objects/complexobject.c	Wed Aug 04 20:56:28 2010 +0000
@@ -394,12 +394,6 @@
     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 @@
     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 */