All pastes #491512 Raw Edit

Untitled

public text v1 · immutable
·published 2007-05-16 18:27 UTC
rendered paste body
def dynamicfunction(func):
    class DynamicFunction(object):
        def __init__(self, func):
            self.func=func
            self._cache={}
        def __call__(self, *args):
            print args
            result=self.func(args)
            return result
    return DynamicFunction(func)

@dynamicfunction
def test(lst):
    pass

test(1,2,3)