Mercurial > cpython-lru_cache-weakref
diff Lib/pprint.py @ 31515:71a294bd7950 legacy-trunk
Replace backticks with repr() or "%r"
From SF patch #852334.
| author | Walter Dörwald <walter@livinglogic.de> |
|---|---|
| date | Thu, 12 Feb 2004 17:35:32 +0000 |
| parents | a2f6c6a67f24 |
| children | 7e3a2c274b36 |
line wrap: on
line diff
--- a/Lib/pprint.py Thu Feb 12 15:28:27 2004 +0000 +++ b/Lib/pprint.py Thu Feb 12 17:35:32 2004 +0000 @@ -212,7 +212,7 @@ typ = _type(object) if typ is str: if 'locale' not in _sys.modules: - return `object`, True, False + return repr(object), True, False if "'" in object and '"' not in object: closure = '"' quotes = {'"': '\\"'} @@ -226,7 +226,7 @@ if char.isalpha(): write(char) else: - write(qget(char, `char`[1:-1])) + write(qget(char, repr(char)[1:-1])) return ("%s%s%s" % (closure, sio.getvalue(), closure)), True, False r = typ.__repr__ @@ -288,7 +288,7 @@ del context[objid] return format % _commajoin(components), readable, recursive - rep = `object` + rep = repr(object) return rep, (rep and not rep.startswith('<')), False
