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

Popular posts from this blog

Hatching array of circles in AutoCAD using c# -

ios - UITEXTFIELD InputView Uipicker not working in swift -

Python Pig Latin Translator -