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

2012-02-11 Thread Paul-Cristian Manta
> > > This is indeed a perfectly valid way to make a metaclass, and it should > definitely work to do the same thing in C++ using the C API and/or > Boost.Python. > > The trouble is using that metaclass as the type of a Boost.Python-wrapped > C++ class...that's what I think is basically impossible.

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

2012-02-08 Thread Paul-Cristian Manta
> -- Forwarded message -- > From: Jim Bosch > To: Development of Python/C++ integration > Cc: > Date: Tue, 07 Feb 2012 11:14:54 -0500 > Subject: Re: [C++-sig] How to define a Python metaclass with Boost.Python? > On 02/07/2012 01:35 AM, paulcmnt wrote: > >> The Python C API has th

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

2012-02-06 Thread Paul-Cristian Manta
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

Re: [C++-sig] Boost.Python: Callbacks to class functions

2011-08-01 Thread Paul-Cristian Manta
On Tue, Aug 2, 2011 at 8:24 AM, Jim Bosch wrote: > > Hmm. That might mean you need to do a big design change; while it often > works, one really isn't supposed to rely on __del__ being called when a > Python object first could be garbage-collected - when cycles are involved, > Python doesn't eve