Subtyping a non-builtin type in C/C++

"Martin v. Löwis" martin at v.loewis.de
Mon Aug 7 08:14:14 EDT 2006


johan2sson at gmail.com schrieb:
> I am trying to create a subclass of a python class, defined in python,
> in C++, but I am having some problems.

Is the base class a classic class or a new-style class? Depending on
the answer, the code you should write varies significantly.

To create a new type, it might be easiest to do the same as the
interpreter. Take, for example, a look at the code that gets executed
for new.classobj("Foo", (), {}).

Regards,
Martin



More information about the Python-list mailing list