Since both Robert and Lisandro has been using templating utility code a 
lot lately, I think this commit was important to note:

You can now do

class StructUtilityCode(object):
     def __eq__(self, other): ...
     def put_code(self, output):
         code = output['utility_code_def']
         proto = output['utility_code_proto']

         code.putln("%s {" % self.header)
         code.putln("PyObject* res;")
         ...

class CStructOrUnionType(CType):
     def create_to_py_utility_code(self, env):
         ...
         env.use_utility_code(StructUtilityCode(self))


The "old" UtilityCode is still available, merely implementing put_code 
by putting the various stored parts in the various places.

http://hg.cython.org/cython-unstable/rev/5a66cd8359e8

and before it.

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

Reply via email to