Re: [C++-sig] checking passed arg is python type

2013-03-14 Thread Neal Becker
Jim Bosch wrote: > On 03/14/2013 06:12 PM, Neal Becker wrote: >> I'm expecting a numpy.random.RandomState object to be passed to me. I want >> to >> check it is. The best I could think of is below. Anything more >> boost::python- ish to do this task? >> >> static object rs_obj; >> >> template >

Re: [C++-sig] checking passed arg is python type

2013-03-14 Thread Jim Bosch
On 03/14/2013 06:12 PM, Neal Becker wrote: I'm expecting a numpy.random.RandomState object to be passed to me. I want to check it is. The best I could think of is below. Anything more boost::python- ish to do this task? static object rs_obj; template struct engine { typedef out_type resul

[C++-sig] checking passed arg is python type

2013-03-14 Thread Neal Becker
I'm expecting a numpy.random.RandomState object to be passed to me. I want to check it is. The best I could think of is below. Anything more boost::python- ish to do this task? static object rs_obj; template struct engine { typedef out_type result_type; bp::object rs;// Ra

Re: [C++-sig] CallPolicy for operators

2013-03-14 Thread Jim Bosch
On 01/27/2013 05:02 AM, Michael Wild wrote: Hi all Is there a way to apply a CallPolicy to operator definitions? In particular, I'm interested in the inplace operators (+=, -=, *=, /= and friends). To give a bit more context: The library I'm trying to wrap exposes some static const objects. So

Re: [C++-sig] [Boost.Python] Resizing boost::numeric::array

2013-03-14 Thread Jim Bosch
On 03/08/2013 07:49 AM, Александров Петр wrote: I have the C++ method which resize boost::numeric::array: void solve(const TReal start_t, const TReal end_t, boost::python::numeric::array &result) { ... result.resize(make_tuple(...)); ... } and this method is called from Python:

Re: [C++-sig] [Boost.Python] Patch to add post-initialization hooks for value_holder

2013-03-14 Thread Jim Bosch
(this is a very late reply, but hopefully it will still be useful) Your patch looks fine to me, but I'm not really sure who is responsible for approving patches and committing them to the Boost.Python codebase these days. I suspect the procedure for doing so is a little bit in flux, as boost i