Python Simple Decorator

Descripción

Create a simple Python decorator


File Template: ❌


Prefix

decorator:simple


Scopes

python


Snippet de código

def ${1:decorator_name}(func):
	def wrapper(*args, **kwargs):
		${2:# Code before calling the function}
		result = func(*args, **kwargs)
		${3:# Code after calling the function}
		return result
	return wrapper

@${1:decorator_name}
def ${4:function_name}():
	${5:pass}