Put an extra space into the repr of a Fraction:
Fraction(1, 2) instead of Fraction(1,2).
diff --git a/Doc/whatsnew/2.6.rst b/Doc/whatsnew/2.6.rst
index 83cca99..d37c5ac 100644
--- a/Doc/whatsnew/2.6.rst
+++ b/Doc/whatsnew/2.6.rst
@@ -616,9 +616,9 @@
>>> float(a), float(b)
(0.66666666666666663, 0.40000000000000002)
>>> a+b
- Fraction(16,15)
+ Fraction(16, 15)
>>> a/b
- Fraction(5,3)
+ Fraction(5, 3)
The :mod:`fractions` module is based upon an implementation by Sjoerd
Mullender that was in Python's :file:`Demo/classes/` directory for a
diff --git a/Lib/fractions.py b/Lib/fractions.py
index 3f070de..123ecb6 100755
--- a/Lib/fractions.py
+++ b/Lib/fractions.py
@@ -187,7 +187,7 @@
def __repr__(self):
"""repr(self)"""
- return ('Fraction(%r,%r)' % (self.numerator, self.denominator))
+ return ('Fraction(%r, %r)' % (self.numerator, self.denominator))
def __str__(self):
"""str(self)"""
diff --git a/Lib/test/test_fractions.py b/Lib/test/test_fractions.py
index cd35644..a79fedd 100644
--- a/Lib/test/test_fractions.py
+++ b/Lib/test/test_fractions.py
@@ -363,7 +363,7 @@
self.assertFalse(R(5, 2) == 2)
def testStringification(self):
- self.assertEquals("Fraction(7,3)", repr(R(7, 3)))
+ self.assertEquals("Fraction(7, 3)", repr(R(7, 3)))
self.assertEquals("7/3", str(R(7, 3)))
self.assertEquals("7", str(R(7, 1)))