Ahh I see.  Ok yeah.  So the typesystem will handle this automatically for you no matter what type you ask for.  There are a bunch of examples of how to do this in cythongen.py, but basically they all come down to calling either `ts.cython_c2py()` or `ts.cython_py2c()` [1, 2] with the appropriate arguments, like the local variable name or whether it lives on a class or not.

These will return code snippets for the declaration, body, and return variable name.  c2py also returns a flag for whether this variable name is cached (on a class) or not.  I imagine you'll want to turn off a lot of these options and then glue the declaration and body together.

1. http://xdress.org/latest/libref/typesystem.html#xdress.typesystem.TypeSystem.cython_c2py
2. http://xdress.org/latest/libref/typesystem.html#xdress.typesystem.TypeSystem.cython_py2c