Python extension modules

Thomas Heller thomas.heller at
Fri Nov 2 10:15:59 CET 2001

[posted and mailed]
"emdpek" <emdpek at> wrote in message news:7fd99f9.0110311606.7e0a5836 at
> Howdy,
> I am working on a Python binding to a library, and wanted to
> clear up some concepts involving extension modules (and,
> more than likely, defining a new type).
> I need Python objects to contain and "represent" native C
> structs.  Is there a way to do this *without* defining a new
> type?  For example, my C binding functions call on library
> functions which return pointer structs.  I can't really
> return these back to Python, as they are not "PyObject*",
> and you can't, for example, convert and return a "void*" via
> Py_BuildValue.  Or can you?

I'm currently working on a 'system' doing exactly this -
defining, creating and manipulating native C structs in
pure Python (with the help of an extension module).

This is in a very early stage, but I'm working on it. is the project page, the link on this
page named 'Accessing and  manipulating C data types' points
to a description of the design.

Although the goal of this project is windows specific, the
'C data types' stuff could probably be made to work cross


More information about the Python-list mailing list