[pygccxml-development] Feature request
Brought to you by:
mbaas,
roman_yakovenko
From: Neal B. <ndb...@gm...> - 2006-04-19 11:05:14
|
AFAIK, these features are not already implemented. 1. keyword arguments 1a. default values 2. docstrings Typically, when I write a python wrapper for a function, I enhance it by adding keyword arguments and maybe default values. Here is an example: template<typename in_cont_t, typename coef_cont_t, typename out_cont_t> out_cont_t inline do_Corr (in_cont_t const& in, coef_cont_t const& coef, size_t size, int stride) { out_cont_t out (size); Corr (boost::begin(in), boost::begin (coef), boost::end (coef), boost::begin (out), boost::end (out), stride); return out; } BOOST_PYTHON_MODULE(corr_wrap) { def ("Corr", &do_Corr<ublas::vector<Complex>,ublas::vector<Complex>,ublas::vector<Complex> >, default_call_policies(), ( arg ("in"), arg ("coef"), arg ("size"), arg ("stride")=1 ) ); def ("Corr", &do_Corr<ublas::vector<double>,ublas::vector<double>,ublas::vector<double> >, default_call_policies(), ( arg ("in"), arg ("coef"), arg ("size"), arg ("stride")=1 ) ); } |