I think I need to ask a better question here, so I'm coming back here with
an adjusted situation.  I've found I can't get Python to bind up to
prototypes for stuff taking std::type_info or boost::type_info.  I suppose
I should be surprised if it actually did.  I'm thinking--what if I have a
Python implementation of an interface I defined in C++?  It would be really
odd if that would even be compatible with type_info in any way.  I am
thinking type_info is not the way to go, but I see some code in Boost
dealing with PyType.

I figure what I need instead is a method that types something else than
type_info, but what I need is a mystery.  For giggles, I just tried to take
a PyObject* and pass in whatever.  if I give it from Python type(Foo) then
I think I get a PyType.  I see some stuff in Boost source code about
working with these.  I'm wondering, is there any helpers for this?  Or any
idea at all what to do?

I suppose the overall situation is this: imagine I have a container of
pointers referencing some interface.  The container contains potentially
both C++ and Python implementations.  All implementations are exposed in
Python.  Is there a way I could pass in some kind of type information and
be able to positively identify if something in that container matches the
type?

On Tue, Feb 21, 2012 at 2:03 AM, Adam Preble <adam.pre...@gmail.com> wrote:

> It'll compile and and I'll get that Remove method fine.  Except I can't
> seem to cram something into it when I try to actually execute the
> subroutine.  Say I have class Bar wrapped in Python too, and I have been
> using it fine and dandy.  How do I get Remove() to accept the type of Bar
> as an argument?
>
>
_______________________________________________
Cplusplus-sig mailing list
Cplusplus-sig@python.org
http://mail.python.org/mailman/listinfo/cplusplus-sig

Reply via email to