diff options
author | Mark Dickinson <dickinsm@gmail.com> | 2010-08-04 20:56:28 (GMT) |
---|---|---|
committer | Mark Dickinson <dickinsm@gmail.com> | 2010-08-04 20:56:28 (GMT) |
commit | 388122d43b2b6bb41774d9680b9ad3bc05682f85 (patch) | |
tree | 4b3059b3dbd916fde44702e732f507788c433fbf /Lib/test/test_float.py | |
parent | b6c50749207688902a6378958da474f7c31f179d (diff) | |
download | cpython-388122d43b2b6bb41774d9680b9ad3bc05682f85.zip cpython-388122d43b2b6bb41774d9680b9ad3bc05682f85.tar.gz cpython-388122d43b2b6bb41774d9680b9ad3bc05682f85.tar.bz2 |
Issue #9337: Make float.__str__ identical to float.__repr__.
(And similarly for complex numbers.)
Diffstat (limited to 'Lib/test/test_float.py')
-rw-r--r-- | Lib/test/test_float.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/test/test_float.py b/Lib/test/test_float.py index a1b130b..ac5fc33 100644 --- a/Lib/test/test_float.py +++ b/Lib/test/test_float.py @@ -617,7 +617,9 @@ class ReprTestCase(unittest.TestCase): negs = '-'+s self.assertEqual(s, repr(float(s))) self.assertEqual(negs, repr(float(negs))) - + # Since Python 3.2, repr and str are identical + self.assertEqual(repr(float(s)), str(float(s))) + self.assertEqual(repr(float(negs)), str(float(negs))) @requires_IEEE_754 class RoundTestCase(unittest.TestCase): |