However, certain API functions return large C structures, which I'd
like to return as a Python class instance containing various
attributes. Is there any way for an extension module written in C to
find the class "Item", create an instance of it, and then add various
attribute variables to the new instance?
One alternative I've considered is to create a dictionary with various
key/value pairs; Python wrappers around the C code could then create a
new class instance and add the values in the dictionary. I'll do that
if creating a class instance in C is impractical or difficult, but
that'll be a *lot* of wrapper functions. I could just return the
dictionary, but I want the resulting Python code to resemble the old C
code for the API as much as possible, so I'd really prefer to use the
'.' syntax for referencing attributes.
So, does anyone have a suggestion as to how this should be
implemented? Thanks in advance...
Andrew Kuchling
fnord@binkley.cs.mcgill.ca