From 781ef52cad9730c396b34dc28b4f06f7a48368fa Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Tue, 15 Sep 2009 08:31:37 +0200 Subject: [PATCH] allow splitting compiler annotation decorators as Python only allows 255 args --- Cython/Compiler/ParseTreeTransforms.py | 6 +++++- tests/run/pure.pyx | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Cython/Compiler/ParseTreeTransforms.py b/Cython/Compiler/ParseTreeTransforms.py index d01d06da..1637dee2 100644 --- a/Cython/Compiler/ParseTreeTransforms.py +++ b/Cython/Compiler/ParseTreeTransforms.py @@ -485,7 +485,11 @@ class InterpretCompilerDirectives(CythonTransform, SkipDeclarations): options.reverse() # Decorators coming first take precedence for option in options: name, value = option - optdict[name] = value + if name in optdict: + # assuming it's a dict ... + optdict[name].update(value) + else: + optdict[name] = value body = StatListNode(node.pos, stats=[node]) return self.visit_with_options(body, optdict) else: diff --git a/tests/run/pure.pyx b/tests/run/pure.pyx index 38910a8e..3013dada 100644 --- a/tests/run/pure.pyx +++ b/tests/run/pure.pyx @@ -67,7 +67,8 @@ def test_address(x): y = cython.address(x) return y[0] -@cython.locals(x=cython.int, y=cython.bint) +@cython.locals(x=cython.int) +@cython.locals(y=cython.bint) def test_locals(x): y = x return y -- 2.26.2