Issue #4113: Added custom __repr__ method to functools.partial.
diff --git a/Lib/test/test_functools.py b/Lib/test/test_functools.py
index e5921a7..f41a144 100644
--- a/Lib/test/test_functools.py
+++ b/Lib/test/test_functools.py
@@ -146,6 +146,32 @@
         join = self.thetype(''.join)
         self.assertEqual(join(data), '0123456789')
 
+    def test_repr(self):
+        args = (object(), object())
+        args_repr = ', '.join(repr(a) for a in args)
+        kwargs = {'a': object(), 'b': object()}
+        kwargs_repr = ', '.join("%s=%r" % (k, v) for k, v in kwargs.items())
+        if self.thetype is functools.partial:
+            name = 'functools.partial'
+        else:
+            name = self.thetype.__name__
+
+        f = self.thetype(capture)
+        self.assertEqual('{}({!r})'.format(name, capture),
+                         repr(f))
+
+        f = self.thetype(capture, *args)
+        self.assertEqual('{}({!r}, {})'.format(name, capture, args_repr),
+                         repr(f))
+
+        f = self.thetype(capture, **kwargs)
+        self.assertEqual('{}({!r}, {})'.format(name, capture, kwargs_repr),
+                         repr(f))
+
+        f = self.thetype(capture, *args, **kwargs)
+        self.assertEqual('{}({!r}, {}, {})'.format(name, capture, args_repr, kwargs_repr),
+                         repr(f))
+
     def test_pickle(self):
         f = self.thetype(signature, 'asdf', bar=True)
         f.add_something_to__dict__ = True
@@ -163,6 +189,9 @@
 
     thetype = PythonPartial
 
+    # the python version hasn't a nice repr
+    def test_repr(self): pass
+
     # the python version isn't picklable
     def test_pickle(self): pass
 
diff --git a/Lib/test/test_inspect.py b/Lib/test/test_inspect.py
index 71f0e8a..b322f7d 100644
--- a/Lib/test/test_inspect.py
+++ b/Lib/test/test_inspect.py
@@ -12,6 +12,7 @@
 
 from test import inspect_fodder as mod
 from test import inspect_fodder2 as mod2
+from test import inspect_fodder3 as mod3
 
 # C module for test_findsource_binary
 import unicodedata
@@ -388,6 +389,12 @@
         self.assertEqual(inspect.findsource(co), (lines,0))
         self.assertEqual(inspect.getsource(co), lines[0])
 
+class TestNoEOF(GetSourceBase):
+    fodderFile = mod3
+
+    def test_class(self):
+        self.assertSourceEqual(mod3.X, 1, 2)
+
 # Helper for testing classify_class_attrs.
 def attrs_wo_objs(cls):
     return [t[:3] for t in inspect.classify_class_attrs(cls)]