- Author: DagSverreSeljebotn
- Status: Idea
NOT DONE!, only draft, I got another idea... :-)
This can mostly be considered a hack.
, in order to be able to implement [:enhancements/operators/ambitious] for NumPy arrays without expecting too complex optimizations of the Cython compiler. The full NumPy problem will be described at the bottom, but the spec comes first.
Please be patient and you'll hopefully see why at the bottom...
To allow a scopevars block within a cdef class:
ctypedef class Foo: char* complex_buffer scopevars: int info
cdef class Foo: def __enterscope__(self): scope(self).info = self.complex_buffer // 4 def bar(self): print scope(self).info
When using this type now, the following happens:
Foo f = ... f.info()
is transformed by the ScopeVarsTransformer to:
Foo f = ... int _scopetmp_f_info _scopetmp_f_info = f.complex_buffer // 34 print _scopetmp_f_info