[C++-sig] R: Re: R: Re: Boost.Python type registry

François Duranleau duranlef at iro.umontreal.ca
Fri Oct 5 17:22:20 CEST 2007

On Fri, 5 Oct 2007, jumpjoe at fastwebnet.it wrote:

>> I think that you can search the registry for entry with m_class_object 
>> that matches your PyObject's type or search the lvalue_chain(s) for a 
>> converter that returns !=0. But there is no api for that so far.
> This is another interesting approach, but after a few tries, I 
> discovered the registry is really hard to get by, as it is a static 
> variable defined in a "hidden" function in an anonymous namespace in the 
> registry.cpp file. Any suggestions on how to extract it? As an "extern" 
> of some kind?

Without modifying the source code, there is no way. The only way to search 
the registry externally is via the boost::python::converter::query 
function, but then you need to provide a type_info, and to do this 
exhaustively is not really simpler than using an "inverse" registry like I 

Francois Duranleau

More information about the Cplusplus-sig mailing list