On 02/06/15 01:34 AM, Christoff Kok wrote:
> Hi,
>
> This looks like a bug in Boost.Python to me.
>
> Could anyone confirm this? I provided a minimal, full working example.
>
> I would like to make sure it is a bug before reporting it as one.

The 'is' operator compares the identities of the two Python objects,
which differ. However, both are referencing the same C++ object.
As a test, add

bool identical(Factory &f1, Factory &f2) { return &f1 == &f2;}

to your C++ and expose that, then use that function to compare the
factory references, instead of 'is'.
Yes, it would be nice if the same Python (wrapper) object would be
returned. I'm not sure how to do that, though. I'll think about it some
more...

HTH,
        Stefan


-- 

      ...ich hab' noch einen Koffer in Berlin...

_______________________________________________
Cplusplus-sig mailing list
Cplusplus-sig@python.org
https://mail.python.org/mailman/listinfo/cplusplus-sig

Reply via email to