[C++-sig] Re: Boost.Python : Byref parameters

Mike Rovner mike at nospam.com
Fri Sep 26 21:48:50 CEST 2003


Joel Gerard wrote:

> .def("Normalize",VectorNormalize1)
> .def("Normalize",VectorNormalize2)
> .def("Normalize",VectorNormalize3)

You have to say .staticmethod("Normalize")

> Only Normalize defined by VectorNormalize3 is broken
> saying: "TypeError: unbound method
> Boost.Python.function object must be called with
> Vector instance as first argument (got float instance
> instead)"

They were wrapped as non-static methods thus require
a 'self' class instance argument first.

HTH,
Mike







More information about the Cplusplus-sig mailing list