summaryrefslogtreecommitdiffstats
path: root/Demo/classes/Complex.py
diff options
context:
space:
mode:
authorWalter Dörwald <walter@livinglogic.de>2004-02-12 17:35:32 (GMT)
committerWalter Dörwald <walter@livinglogic.de>2004-02-12 17:35:32 (GMT)
commit70a6b49821a3226f55e9716f32d802d06640cb89 (patch)
tree3c8ca10c1fa09e025bd266cf855a00d7d96c55aa /Demo/classes/Complex.py
parentecfeb7f095dfd9c1c8929bf3df858ee35e0d9e9e (diff)
downloadcpython-70a6b49821a3226f55e9716f32d802d06640cb89.zip
cpython-70a6b49821a3226f55e9716f32d802d06640cb89.tar.gz
cpython-70a6b49821a3226f55e9716f32d802d06640cb89.tar.bz2
Replace backticks with repr() or "%r"
From SF patch #852334.
Diffstat (limited to 'Demo/classes/Complex.py')
-rwxr-xr-xDemo/classes/Complex.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Demo/classes/Complex.py b/Demo/classes/Complex.py
index 4585f62..a9f5c2e 100755
--- a/Demo/classes/Complex.py
+++ b/Demo/classes/Complex.py
@@ -117,15 +117,15 @@ class Complex:
def __repr__(self):
if not self.im:
- return 'Complex(%s)' % `self.re`
+ return 'Complex(%r)' % (self.re,)
else:
- return 'Complex(%s, %s)' % (`self.re`, `self.im`)
+ return 'Complex(%r, %r)' % (self.re, self.im)
def __str__(self):
if not self.im:
- return `self.re`
+ return repr(self.re)
else:
- return 'Complex(%s, %s)' % (`self.re`, `self.im`)
+ return 'Complex(%r, %r)' % (self.re, self.im)
def __neg__(self):
return Complex(-self.re, -self.im)