Suppose I have a functor, e.g.: template<typename F> struct mag_sqr1 { F operator() (F z) { return (z * z); } }; Any way to expose this a a python function? def ("mag_sqr", ???);