Steven Barker added the comment: Ah, I figured out why using %R may be bad. It breaks for the following silly class:
class C(): def __repr__(self): return repr(self.__repr__) # or use any other bound method repr(C()) will recurse until the recursion limit is hit, both with and without my patch. If this seems like a real issue, I could probably replace the %R code with a variation on the base case code in PyObject_Repr: PyUnicode_FromFormat("<%s object at %p>", v->ob_type->tp_name, v) ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue21389> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com