Cross-language class relationship

Alexander Staubo alexspam at mop.no
Tue May 18 22:39:36 EDT 1999


Can a Python script's classes inherit from a class implemented by a C++ 
extension, and can a C++ extension's classes inherit (in some sense of 
the word) from a Python-implemented class?

I know that SWIG supports "shadow classes" for C++ integration. I 
honestly haven't bothered to test how successfully the two integrate; 
since SWIG's shadow classes are ordinary Python classes, I assume it 
works pretty well. The question, though, is the ability for a C or C++ 
extension's classes to descend from ones implemented in Python.

It sounds unlikely, but it would be _very_ helpful in implementing parts 
of a complex application for efficiency.

-- 
Alexander Staubo
mailto:alex at mop.no
http://www.mop.no/~alex




More information about the Python-list mailing list