Quick actions

cmd+k|ctrl+k

Navigation

Languages

Decorator: 2026 Jan 21 

Snippet info

Language

Python

Visibility

public

Author

andrewlyk

Created

2026-01-21T06:37:45.741579Z

Updated

2026-01-21T06:39:18.948871Z

def param(count):
    def counter(fn):
        def inner(*args,**kwarg):
            nonlocal count
            count+=1
            print("Function {0} called {1} times".format(fn.__name__,ccount))
            return fn(*args,**kwarg)
        return inner
    return counter
        

def add(a,b=0):
    return a+b

add= param(10)(add)
INFO