def sub(x, y):
    return x - y

def div(x, y):
    return x/y

def attach_wrap(func1, func2=None):
    if func2 is None:
        return partial(attach_wrap, func1)
    setattr(func1, func2.__name__, func2)
    return func1

sub1 = attach_wrap(sub)
print(sub1)

sub2 = sub1(div)
print(sub2)

print(sub2(20, 10)) //10
print(sub2.div(20, 10)) //2.0