python - Generate a function which has a decorator -
i know can generate functions lambda expressions or setattr
, there way generate functions @ runtime have decorators? example create @property
, @<name>.setter
functions @ runtime.
well, given that
@decorator(config) def function(args): # ...
is syntactic sugar for
def function(args): # ... function = decorator(config)(function)
i'm sure can figure out rest. :)
Comments
Post a Comment