def visit_FunctionDef(self, t): fn = Function(t.name, t.args, t.body) for d in reversed(t.decorator_list): fn = Call(d, [fn]) return ast.Assign([ast.Name(t.name, store)], fn)