From: Mark Dickinson Date: Thu, 17 Sep 2009 00:17:48 +0000 (+0000) Subject: Bypass long_repr and _PyLong_Format for str(n), repr(n) X-Git-Tag: v3.2a1~2557 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2031d13172078a1b71e37459c2611baa85d8deb9;p=python Bypass long_repr and _PyLong_Format for str(n), repr(n) --- diff --git a/Objects/longobject.c b/Objects/longobject.c index 3e7ae04a48..9f414ca8a9 100644 --- a/Objects/longobject.c +++ b/Objects/longobject.c @@ -2515,12 +2515,6 @@ long_dealloc(PyObject *v) 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 @@ PyTypeObject PyLong_Type = { 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 */