I want to import a function:
from random import randint
and then apply a decorator to it:
@decorator
randint
I was wondering if there was some syntactic sugar for this (like what I have above), or do I have to do it as follows:
@decorator
def randintWrapper(*args):
return random.randint(*args)
question from:https://stackoverflow.com/questions/25829364/applying-a-decorator-to-an-imported-function