
18 Jan
2005
18 Jan
'05
5:52 p.m.
Hi, I am wrapping a class "bigint" from c++ to python. I have overloaded the add method to do something like this on python:
n=bigint(5); n+5L 5
This works well, but if I try to do it vice versa my overloaded add method isn't called by python:
n=bigint(5); 5L+n Causes error.
My add methods look like this: bigint add_bigint_l(bigint const& b, long_ const& l) bigint add_l_bigint(long_ const& l,bigint const& b) and are defined by .def("__add__", add_bigint_l) .def("__add__", add_l_bigint) Can someone tell me howto realize it? Benjamin Schmeling -- GMX im TV ... Die Gedanken sind frei ... Schon gesehen? Jetzt Spot online ansehen: http://www.gmx.net/de/go/tv-spot