Associating a C++ class with a Python class

Mahrt, Dallas dallasm at
Fri Jun 14 22:20:32 CEST 2002

I would read the following link

> -----Original Message-----
> From: jhndnn at [mailto:jhndnn at] 
> Sent: Friday, June 14, 2002 4:13 PM
> To: python-list at
> Subject: Associating a C++ class with a Python class
> I would like to add a new class type to my embedded python 
> engine and I would like this class to wrap an exisiting C++ 
> class instance. All of the examples I have found are more 'c 
> implementation' than 'c wrappers', meaning that the python 
> instance is not associated with an different c++ class. The 
> methods of the python class will just be straight calls 
> through to the C++ class.
> These classes will only be created from C, so I am basically 
> looking for a way to stuff a pointer to my C++ class into the 
> python object. I guess I could have a map of PyObject->C++ 
> class, but I was hoping there was a cleaner way to accompish 
> this task. Is there a standard way to do this? Am I missing 
> something obvious?
> Thanks-
> John
> --
> John Dunn
> Peak Audio, a division of Cirrus Logic, Inc.
> -- 

More information about the Python-list mailing list