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

Serhiy Storchaka report at bugs.python.org
Mon Mar 6 09:58:02 EST 2017


Serhiy Storchaka added the comment:

What about C stack consumption? Is not this increase it?

Since nested partial()`s are collapsed, you need to interlace them with other wrapper for testing.

def decorator(f):
    def wrapper(*args):
        return f(*args)
    return wrapper

def f(*args): pass

for i in range(n):
    f = partial(f)
    f = decorator(f)

f(1, 2)

----------
components: +Extension Modules
stage:  -> patch review

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


More information about the Python-bugs-list mailing list