In the upcoming release we'll get fused types, which may do what you
want. This page describes how you can use them and what you can do
with them: https://sage.math.washington.edu:8091/hudson/job/cython-docs/doclinks/1/src/userguide/fusedtypes.html
To use them right now you'll need to checkout cython from github
(https://github.com/cython/cython).
def func(cython.floating arg):
cdef mycpptype[cython.floating] cppobj = new mycpptype[cython.floating]()
...
You can only specialize fused types through function parameters
currently, so you cannot use fused types as part of structs, cdef
classes or to define C++ templates. I'm not sure if the above does
what you want, but perhaps you want to see my other post:
http://groups.google.com/group/cython-users/browse_thread/thread/a90a4ca3784642a2