[issue29735] Optimize functools.partial() for positional arguments

Serhiy Storchaka report at bugs.python.org
Mon Mar 6 11:52:11 EST 2017


Serhiy Storchaka added the comment:

If the underlying function doesn't support fast call, and either args or pto->args are empty, partial_call() makes two unneeded copyings. Arguments are copied from a tuple to the raw array and from the array to new tuple. This is what the current code does, but this can be avoided.

If the underlying function doesn't support fast call, and both args and pto->args are not empty, patched partial_call() makes one unneeded copyings. Arguments are copied from tuples to the raw array and from the array to the new tuple. Only one copying is needed (from tuples to the new tuple).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue29735>
_______________________________________


More information about the Python-bugs-list mailing list