[Python-checkins] r74858 - python/branches/py3k/Objects/longobject.c

mark.dickinson python-checkins at python.org
Thu Sep 17 02:17:48 CEST 2009


Author: mark.dickinson
Date: Thu Sep 17 02:17:48 2009
New Revision: 74858

Log:
Bypass long_repr and _PyLong_Format for str(n), repr(n)

Modified:
   python/branches/py3k/Objects/longobject.c

Modified: python/branches/py3k/Objects/longobject.c
==============================================================================
--- python/branches/py3k/Objects/longobject.c	(original)
+++ python/branches/py3k/Objects/longobject.c	Thu Sep 17 02:17:48 2009
@@ -2515,12 +2515,6 @@
 	Py_TYPE(v)->tp_free(v);
 }
 
-static PyObject *
-long_repr(PyObject *v)
-{
-	return _PyLong_Format(v, 10);
-}
-
 static int
 long_compare(PyLongObject *a, PyLongObject *b)
 {
@@ -4289,13 +4283,13 @@
 	0,					/* tp_getattr */
 	0,					/* tp_setattr */
 	0,					/* tp_reserved */
-	long_repr,				/* tp_repr */
+	long_to_decimal_string,			/* tp_repr */
 	&long_as_number,			/* tp_as_number */
 	0,					/* tp_as_sequence */
 	0,					/* tp_as_mapping */
 	(hashfunc)long_hash,			/* tp_hash */
 	0,					/* tp_call */
-	long_repr,				/* tp_str */
+	long_to_decimal_string,			/* tp_str */
 	PyObject_GenericGetAttr,		/* tp_getattro */
 	0,					/* tp_setattro */
 	0,					/* tp_as_buffer */


More information about the Python-checkins mailing list