Re: [C++-sig] Boost Python objects and object identity

2009-09-29 Thread Pertti Kellomäki
Roman Yakovenko wrote: For example, you can expose "this" pointer to Python and use it as your id: Thanks, this sounds like what I was looking for. -- Pertti ___ Cplusplus-sig mailing list Cplusplus-sig@python.org http://mail.python.org/mailman/listin

Re: [C++-sig] Boost Python objects and object identity

2009-09-29 Thread Alex Mohr
Renato Araujo wrote: I had the same problem as you in my binding implementation, then I solve the problem using this function: // // a generator with an execute() function which, given a source type // and a pointer to an object of that type, returns its most-derived // /reachable/ type identifi

Re: [C++-sig] Boost Python objects and object identity

2009-09-29 Thread Roman Yakovenko
2009/9/29 Pertti Kellomäki : > I have Python bindings for a C++ library that among other > things contains classes for describing the static structure > of a microprocessor. > > My background is in Lisp, so I am used to using object > identities (references) as keys. The C++ library can > be used i

Re: [C++-sig] Boost Python objects and object identity

2009-09-29 Thread Renato Araujo
Hi Pertti I had the same problem as you in my binding implementation, then I solve the problem using this function: // // a generator with an execute() function which, given a source type // and a pointer to an object of that type, returns its most-derived // /reachable/ type identifier and objec

[C++-sig] Boost Python objects and object identity

2009-09-29 Thread Pertti Kellomäki
I have Python bindings for a C++ library that among other things contains classes for describing the static structure of a microprocessor. My background is in Lisp, so I am used to using object identities (references) as keys. The C++ library can be used in this fashion, e.g. looking up a registe