[C++-sig] Something like boost::any ... custom conversions?

Alex Mohr amohr at pixar.com
Thu Nov 17 03:36:35 CET 2005

So I'm back working on this now -- trying to register custom covnersions 
for my any-like object.

> You can do it for specific held types just by registering the
> appropriate from_python converters:

Cool -- that's all I want to do...

> I suggest you look at
> http://news.gmane.org/find-root.php?message_id=%3c1026918209.17167.2.camel%40hunsmac.mit.edu%3e
> and follow the links there.  It's probably about time to document this
> stuff for real and pull it out of the detail:: namespaces.

Thanks for the links.  I feel like I have a good general understanding 
of what needs doing.  The problem is I don't know how to tell whether 
the PyObject * that is passed to convertible() is pointing to (a wrapper 
of) my any-like object, and if it is, how to get it out.

I think this is what you were referring to when you said that the bigger 
issue is that I don't have the Python type object associated with my 
any-like class at compile time, correct?

If anybody has any hints for doing that, I'd greatly appreciate it.



More information about the Cplusplus-sig mailing list