1 2 3 4 5 6 7 8
def action(self, func=None, subordinate_ok=False): def _wrapper(func): ... self[func.__name__] = { ... 'subordinate_ok': subordinate_ok, } return _wrapper(func) if func else _wrapper