
21 Aug
2003
21 Aug
'03
3:07 p.m.
cavok@filibusta.crema.unimi.it writes:
hi,
i attached a simple example that shows the following behavior:
$ python Python 2.2.3+ (#1, Aug 10 2003, 10:11:23) [GCC 3.3.1 (Debian)] on linux2 Type "help", "copyright", "credits" or "license" for more information.
import test a=test.A() a.f(3) double a.f(3.8) double a.f(int(3)) double
$
well, doesn't it look weird?
any idea on how i can get the correct c++ method called?
Reverse the order of the .def calls -- Boost.Python prefers later defs and Python ints match C++ double args, but not vice-versa. Yes, this really should be documented. One day we will have "best match" overloading and this issue will disappear. HTH, -- Dave Abrahams Boost Consulting www.boost-consulting.com