Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python call function that need args with decorator

@decorator
def foo(*args, **kwargs):
    pass
# translates to

foo = decorator(foo)
# So if the decorator had arguments,

@decorator_with_args(arg)
def foo(*args, **kwargs):
    pass
# translates to

foo = decorator_with_args(arg, foo)
 
PREVIOUS NEXT
Tagged: #python #call #function #args #decorator
ADD COMMENT
Topic
Name
1+6 =