summaryrefslogtreecommitdiff
path: root/Cython/Compiler/CythonScope.py
diff options
context:
space:
mode:
authorMark Florisson <markflorisson88@gmail.com>2011-07-18 18:37:40 +0200
committerMark Florisson <markflorisson88@gmail.com>2011-07-19 12:55:19 +0200
commitec1b697c9ee49ef0fd111f8f670d8ac3811638cc (patch)
treeec45a98c1d3b55ae111919ba98994c0ac13c738a /Cython/Compiler/CythonScope.py
parentab8b5f9d545c33a8f6b567ed5fcd9b9a9f859929 (diff)
downloadcython-ec1b697c9ee49ef0fd111f8f670d8ac3811638cc.tar.gz
Support CythonUtilityCode dependencies in CythonUtilityCode
Diffstat (limited to 'Cython/Compiler/CythonScope.py')
-rw-r--r--Cython/Compiler/CythonScope.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/Cython/Compiler/CythonScope.py b/Cython/Compiler/CythonScope.py
index f6655a995..55b78a5e2 100644
--- a/Cython/Compiler/CythonScope.py
+++ b/Cython/Compiler/CythonScope.py
@@ -111,11 +111,20 @@ undecorated_methods_protos = UtilityCode(proto=u"""
PyObject *self, PyObject *value);
""")
+test_cython_utility_dep = CythonUtilityCode(u"""
+@cname('__pyx_test_dep')
+cdef test_dep(obj):
+ print 'test_dep', obj
+""")
+
cython_test_extclass_utility_code = CythonUtilityCode(
name="TestClassUtilityCode",
prefix="__pyx_prefix_TestClass_",
- requires=[undecorated_methods_protos],
+ requires=[undecorated_methods_protos, test_cython_utility_dep],
impl=u"""
+cdef extern from *:
+ cdef object __pyx_test_dep(object)
+
@cname('__pyx_TestClass')
cdef class TestClass(object):
cdef public int value
@@ -147,6 +156,10 @@ cdef class TestClass(object):
def def_cname_method(self, int value):
print "Hello from def_cname_method", value
+@cname('__pyx_test_call_other_cy_util')
+cdef test_call(obj):
+ print 'test_call'
+ __pyx_test_dep(obj)
@cname('__pyx_TestClass_New')
cdef _testclass_new(int value):