Commits

Manuel Jacob  committed 90dd1de

Fix TestPartial.test_repr().

  • Participants
  • Parent commits 2ede4cf
  • Branches py3k

Comments (0)

Files changed (1)

File lib_pypy/_functools.py

         if self.keywords is not None:
             fkeywords = dict(self.keywords, **fkeywords)
         return self.func(*(self.args + fargs), **fkeywords)
+
+    def __repr__(self):
+        cls = type(self)
+        if cls is partial:
+            name = 'functools.partial'
+        else:
+            name = cls.__name__
+        tmp = [repr(self.func)]
+        for arg in self.args:
+            tmp.append(repr(arg))
+        if self.keywords:
+            for k, v in self.keywords.items():
+                tmp.append("{}={!r}".format(k, v))
+        return "{}({})".format(name, ', '.join(tmp))