Grew Ewing created Pyrex, a language with python-like syntax for writing C modules that easily port into Python:
Pyrex deals with the basic types just as easily as SWIG, but it also lets you write code to convert between arbitrary Python data structures and arbitrary C data structures, in a simple and natural way, without knowing anything about the Python/C API. That's right -- nothing at all! Nor do you have to worry about reference counting or error checking -- it's all taken care of automatically, behind the scenes, just as it is in interpreted Python code. And what's more, Pyrex lets you define new built-in Python types just as easily as you can define new classes in Python.
Most notably, you can declare types on your function variables, if you wish.
Posted by Peter at February 4, 2004 06:14 PM