[C++-sig] CXX : getting a C++ object

Benjamin Golinvaux Benjamin.Golinvaux at euresys.com
Sat Aug 28 23:47:51 CEST 2004


Hello

I would like to wrap a small C++ library using CXX.

I would like to know how I can extract the C++ instance
from a PyObject passed to a function. Can I assume, after
a correct type check, that I can safely downcast the PyObject
? (or using dynamic_cast ?)

If I can't (or don't want to) use dynamic_cast , what could 
then be the best way to test that a PyObject is actually
from a wrapped C++ "python type" class ?  (sorry I'm a beginner
in the Python C API)

Thanks for your help

Benjamin Golinvaux 

--------------------------------------------------------
The information contained in this message or any of its attachments may be privileged and confidential and intended for the exclusive use of the addressee. If you are not the addressee any disclosure, reproduction, distribution or other dissemination or use of this communication is strictly prohibited. If you have received this transmission by error please notify the sender immediately and then delete this email. EURESYS shall not be liable for any loss of or damage to revenues, profits, goodwill, data, information systems or other special, incidental, indirect, consequential or punitive damages of any kind arising in connection with the use of information contained in this mail or its attachments. Email transmission cannot be guaranteed to be secure or error free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore is in no way liable for any errors or omissions in the content of this message, which may arise as a result of email transmission. If verification is required, please request a hard copy. Please note that neither EURESYS, nor the sender accepts any responsibility for viruses and it is your responsibility to scan attachments (if any).


--------------------------------------------------------



More information about the Cplusplus-sig mailing list