[Pyrex] Python type syntax for Pyrex?

Greg Ewing greg.ewing at canterbury.ac.nz
Fri Jan 28 11:31:05 CET 2005


Phillip J. Eby wrote:
> Guido's latest type syntax proposal at 
> http://www.artima.com/weblogs/viewpost.jsp?thread=87182 looks almost 
> like it might be suitable for use in a future version of Pyrex in place 
> of cdef+type prefixes.
> 
> It's interesting to think about, and to wonder if ctypes and Pyrex could 
> converge on a common way to "spell" C types as Python type expressions.
 >
> Then, one could prototype code with ctypes and then compile it with 
> Pyrex, or add type expressions to regular Python code and compile with 
> Pyrex to enhance performance.

I don't think it's going to be as simple as that. Even if
the syntaxes are similar, Pyrex will still need a way of
distinguishing between Python types and C types. For
example, a Python 'long' is a very different thing from
a C 'long'. So there will always have to be some piece of
syntax, not part of regular Python, that says to Pyrex
"this is a C type, not a Python type".

--
Greg




More information about the Pyrex mailing list