[C++-sig] small operators bug

David Abrahams dave at boost-consulting.com
Thu Oct 6 15:09:54 CEST 2005


Roman Yakovenko <roman.yakovenko at gmail.com> writes:

> Hi. I think I found bug in boost.python operators treatment.
> Consider next code:
>
> C++ code:
>

<snip>

> The last python statement raises exception:
>     unsupported operand type(s) for +: 'integral' and 'integral'
>
> If I remove this line ".def( bp::self + bp::other< int >() );",
> then all works as expected.

It's not a bug.  The behavior matches the usual function hiding
behavior in C++ derived classes, and, I believe, it also matches the
behavior of regular Python classes.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com




More information about the Cplusplus-sig mailing list