From f1690b11330a3a0284b729b44fa1198f29930cbc Mon Sep 17 00:00:00 2001 From: Vitja Makarov Date: Tue, 21 Aug 2012 23:52:42 +0400 Subject: [PATCH] Set DefNode's decorators to None after assignment synthesis --- Cython/Compiler/ParseTreeTransforms.py | 1 + tests/run/decorator_lambda.pyx | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/Cython/Compiler/ParseTreeTransforms.py b/Cython/Compiler/ParseTreeTransforms.py index 481a512..caa8ff7 100644 --- a/Cython/Compiler/ParseTreeTransforms.py +++ b/Cython/Compiler/ParseTreeTransforms.py @@ -1611,6 +1611,7 @@ if VALUE is not None: decorator.pos, function = decorator.decorator, args = [rhs]) + def_node.decorators = None assmt = Nodes.SingleAssignmentNode( def_node.pos, diff --git a/tests/run/decorator_lambda.pyx b/tests/run/decorator_lambda.pyx index 39bcf10..085e6f2 100644 --- a/tests/run/decorator_lambda.pyx +++ b/tests/run/decorator_lambda.pyx @@ -13,3 +13,12 @@ class TestClassDecorator(object): """ def hello(self): return "Hello, world!" + + +@decorate(lambda x: x) +def test_function(): + """ + >>> test_function() + 123 + """ + return 123 -- 2.7.4