Brunn
Thursday, 22 August 2013
Apply one of two decorators according to a condition in Python
Apply one of two decorators according to a condition in Python
I want to do something like
if a:
dec = decorator_1
else:
dec = decorator_2
@dec
def foo():
pass
possible?
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment