diff options
author | Mark Florisson <markflorisson88@gmail.com> | 2011-08-04 23:29:43 +0200 |
---|---|---|
committer | Mark Florisson <markflorisson88@gmail.com> | 2011-09-30 14:57:15 +0100 |
commit | 917cce5ea10ecb21c8ccd607c447d1b13d4fecc9 (patch) | |
tree | 98a47a5a7e73dcff99120e636fb3c0592f4008d1 /Cython/Compiler/CythonScope.py | |
parent | d7322d2f019cb1a9d008da460fcec6a9bf8a02c9 (diff) | |
download | cython-917cce5ea10ecb21c8ccd607c447d1b13d4fecc9.tar.gz |
Support casting pointers to cython.array
Diffstat (limited to 'Cython/Compiler/CythonScope.py')
-rw-r--r-- | Cython/Compiler/CythonScope.py | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/Cython/Compiler/CythonScope.py b/Cython/Compiler/CythonScope.py index 2e3cc44a7..f9bd7f335 100644 --- a/Cython/Compiler/CythonScope.py +++ b/Cython/Compiler/CythonScope.py @@ -71,12 +71,14 @@ class CythonScope(ModuleScope): # self.test_cythonscope() def test_cythonscope(self): - # A special function just to make it easy to test the scope and - # utility code functionality in isolation. It is available to - # "end-users" but nobody will know it is there anyway... + """ + Creates some entries for testing purposes and entries for + cython.array() and for cython.view.*. + """ cython_testscope_utility_code.declare_in_scope(self) cython_test_extclass_utility_code.declare_in_scope(self) - cython_array_utility_code.declare_in_scope(self) + + MemoryView.cython_array_utility_code.declare_in_scope(self) # # The view sub-scope @@ -92,7 +94,9 @@ class CythonScope(ModuleScope): cythonview_testscope_utility_code.declare_in_scope(viewscope) - view_utility_code.declare_in_scope(viewscope) + view_utility_scope = MemoryView.view_utility_code.declare_in_scope(viewscope) + MemoryView.memview_fromslice_utility_code.from_scope = view_utility_scope + MemoryView.memview_fromslice_utility_code.declare_in_scope(viewscope) def create_cython_scope(context, create_testscope): @@ -132,15 +136,4 @@ cython_test_extclass_utility_code = \ requires=[undecorated_methods_protos, test_cython_utility_dep]) -cythonview_testscope_utility_code = load_testscope_utility("View.TestScope") - -view_utility_code = MemoryView.load_memview_cy_utility( - "View.MemoryView", context=MemoryView.context, - requires=[Buffer.GetAndReleaseBufferUtilityCode(), - MemoryView.memviewslice_declare_code], -) - -cython_array_utility_code = MemoryView.load_memview_cy_utility( - "CythonArray", - context=MemoryView.context, - requires=[view_utility_code]) +cythonview_testscope_utility_code = load_testscope_utility("View.TestScope")
\ No newline at end of file |