Python/C interface proposals

Dave Abrahams abrahams at mediaone.net
Mon May 1 23:10:06 EDT 2000


I propose some simple changes to the Python header files which would make it
much easier to write "clean" wrappers in C++.

The first change I propose would make it possible to forward-declare any
struct in the Python headers. This could be done by changing declarations of
the form:

    typedef struct {...} Name;

to:

    typedef struct Name {....} Name;

I'd also like to move these type declarations into separate header files so
that users of my "clean" wrappers will not be inadvertently affected by the
functions declared in the global namespace. More imporantly, I'd like to
drop the macros into separate headers so they won't collide with (and change
the meaning of) names in client code.

Naturally, the standard header files would still include all the neccessary
headers to produce the same results they do today.

I'd be happy to supply the manpower to make these changes, but I thought
first I'd float a trial balloon so that the entire Python community can
shoot the idea down ;)

Wishfully,
Dave




More information about the Python-list mailing list