Issue #27137: align Python & C implementations of functools.partial

The pure Python fallback implementation of functools.partial
now matches the behaviour of its accelerated C counterpart for
subclassing, pickling and text representation purposes.

Patch by Emanuel Barry and Serhiy Storchaka.
This commit is contained in:
Nick Coghlan 2016-09-10 20:00:02 +10:00
parent eddc4b7272
commit 457fc9a69e
4 changed files with 179 additions and 89 deletions

View file

@ -229,7 +229,7 @@ partial_repr(partialobject *pto)
if (status != 0) {
if (status < 0)
return NULL;
return PyUnicode_FromFormat("%s(...)", Py_TYPE(pto)->tp_name);
return PyUnicode_FromString("...");
}
arglist = PyUnicode_FromString("");