[C++-sig] Abstract class instances to-python conversion

Valentin Perrelle valentin.perrelle at orange.fr
Sun Jul 31 00:18:32 CEST 2011


Thank you for your answer.

 > Why do you think you can't have noncopyable?

I understood it prevents the registration of converters for the class. I 
just read the manual again and now i understand it only remove converter 
which copy instances, i.e. conversion of values.

> Anyhow, I'd recommend trying
>
> class_<Keyboard, noncopyable>("Keyboard", no_init);
>
> with the rest of what you have.

That's what I initially tried. It produced runtime error:

TypeError: No Python class registered for C++ class OIS::Keyboard

Thanks to you, I know understand some points i couldn't catch reading 
the manual 3-4 times. I'm now able to fix the current problem by 
importing my module before assigning the variable 'keyboard'. Which 
leads me to another question : is there a way to register converters 
without importing the module ?




More information about the Cplusplus-sig mailing list