[C++-sig] How to define a Python metaclass with Boost.Python?

paulcmnt paulc.mnt at gmail.com
Tue Feb 7 07:35:11 CET 2012


The Python C API has the `PyObject *PyType_Type` object, which is equivalent
to `type` in the interpreter. If I want to define a metaclass in C++, how
can I set `type` as one of its bases in Boost.Python? Also, what other
things should I take into consideration when defining a Python metaclass in
C++? It'd be ideal if there was a Boost.Python solution to this. If not, a
solution that uses the Python C API (or a combination of Boost and the C
API) is good as well. (The version I'm using is Python 3.)

--
View this message in context: http://boost.2283326.n4.nabble.com/How-to-define-a-Python-metaclass-with-Boost-Python-tp4363906p4363906.html
Sent from the Python - c++-sig mailing list archive at Nabble.com.


More information about the Cplusplus-sig mailing list