[PyKDE] Using SIP to wrap python objects

Frederick Polgardy Jr polgardy at bodacion.com
Fri Jun 13 03:07:00 BST 2003


On Thursday 12 June 2003 18:31, Rob Knapp wrote:
> I've found myself in a position where I need to present a python object
> to a C++ object, and it needs to look like a C++ object.  The target
> application knows nothing of python.
>
> Would it be possible to create an object using SIP that I can inherit
> from and use the SIP api to convert into a CppPointer?
>
> Is there another/better way to achieve this?

Why not write what's called (in "Patterns" speak) an Adaptor class: one 
which provides its own interface, and keeps track of the Python objects it 
needs to use internally.  What kind of interface is the target application 
expecting?




More information about the PyQt mailing list