On Jun 27, 2009, at 1:02 AM, Dag Sverre Seljebotn wrote:

> Just a quick note that in the gsoc-kurt branch I've implemented this:
>
> from UtilityCode import CythonUtilityCode
>
> ...
>     env.use_utility_code(foo) # only on env. currently, not code.
>
>
> foo = CythonUtilityCode(u"""
>
> class __Pyx_UtilClass:
>      pass
>
> cdef int __Pyx_UtilityFunction(int arg):
>      return arg * 2
>
> """)
>
> Now, this will cause __Pyx_UtilityFunction to be dumped into the  
> final C
> file, and the type descriptor to be called __Pyx_UtilClass (i.e. name
> mangling is dropped in some important cases).
>
> The details might change around a bit, this is just a note to say I've
> done it, so that noone else starts on something similar.

I'm not opposed to this.

Eventually we may want to consider grouping such code into a central  
Cython module, or at least .h file (for multi-file compilation) as  
there is a lot of redundancy between modules with all the utility  
code produced.

- Robert


_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to