Hi, Dag Sverre Seljebotn wrote: > Currently, wherever a C type is used in Cython, it is enough to specify > sort-of what kind of class of type it is... the following will work all > right: > > cdef extern ...: > ctypedef int int8 > ctypedef int int16 > ctypedef int int32 > ctypedef int int64 > > > However, when types are used in buffers: > > cdef object[int16, 3] x > > one must translate the type (dtype) into a character representation (as > listed in http://docs.python.org/lib/module-struct.html).
What about going the opposite way and either a) replacing the type definition in buffers by the type character entirely (not sure, but this might not work if you require a specific type name to appear in the C code), or b) by requiring users to provide both the type and the character in a suitable buffer declaration syntax? Stefan _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
