boost::python , dispatching in python
arnaldur at ru.is
Wed Jan 9 20:20:34 CET 2002
This is a multi-part message in MIME format.
> So it looks like PyNumber_Add is the way to go for a + b
> That's the wrong conclusion to draw. The check for list[int] is purely
> optimization, just like the check for int+int in the first case.
> PyObject_GetItem() is the simple generalized routine that works for
> sequence and mapping protocols:
> There's no conflict, but the procedure you specified wouldn't work.
> PyObject_GetItem(). Almost every operation with a possible slot
> a similar dispatcher, I'll wager.
You're right! Forgot to take a look at PyObject_GetItem.
I understand where you're going now. By calling PyNumber_Add and
PyObject_GetItem, the python implementation already takes care of
sequence/number, sequence/mapping conflicts for us.
By picking the right python dispatcher we're off the hook.(I wish).
More information about the Cplusplus-sig