boost::python, returning new PyObject references
Arnaldur Gylfason
arnaldur at decode.is
Mon Jan 7 17:45:54 CET 2002
> I don't think there's any reason that C++ functions which are generic
over
> python types need to be templated. I'd like to help people avoid
templates
> whenever its appropriate.
Yeah maybe. I think is is easy to get used to template programming but of
course if there is no benefit ...
Using template functions can of course cause code bloat.
If we use inheritance I think we should consider virtual functions.
Overriding non-virtual functions is normally
considered bad practice.
It can be argued there is no reason to override sequence methods in list.
The PySequence_* calls should work the same as PyList_* calls.
The difference is probably that PyList_* knows exactly what function to
call (makes inlining possible ?)
but PySequence_* has to use function pointers
(o->ob_type->tp_as_sequence->sq_concat).
More information about the Cplusplus-sig
mailing list