[C++-sig] boost::multi_array numpy conversion

2009-06-06 Thread John Reid
I've developed some boost::python code that allows conversion from numpy arrays to boost::multi_array_refs and from boost::multi_array(ref)s to numpy arrays without copying data. It does not deal with lifetime management but nevertheless I've found it very useful. I know pyublas performs a simi

[C++-sig] Py3k unicode to const char* conversion solved (Re: boost::python for Python 3.0)

2009-06-06 Thread Haoyu Bai
Hi, After attempted all the hacks come from my mind, I solved the unicode string to const char* conversion problem by simply calling a Python C-API: _PyUnicode_AsString. Since it is start with an underscore, it is not a public API and not documented. But I wonder why it is not documented, as it's

Re: [C++-sig] Py3k unicode to const char* conversion solved (Re: boost::python for Python 3.0)

2009-06-06 Thread Stefan Seefeld
Haoyu Bai wrote: Hi, After attempted all the hacks come from my mind, I solved the unicode string to const char* conversion problem by simply calling a Python C-API: _PyUnicode_AsString. Since it is start with an underscore, it is not a public API and not documented. But I wonder why it is not d

[C++-sig] g++ compiler limitations other than -ftemplate-depth-n and -DBOOST_PYTHON_MAX_ARITY ?

2009-06-06 Thread Christopher A Mejia
Hi, I'm using pyplusplus and Boost.Python to wrap a class where one of the member functions has many (28) arguments, most of them with default values. The wrapping code handles the default arguments with the Py++ "do nothing" approach, i.e. not by using the BOOST_PYTHON_MEMBER_FUNCTION_OVERLOA

Re: [C++-sig] g++ compiler limitations other than -ftemplate-depth-n and -DBOOST_PYTHON_MAX_ARITY ?

2009-06-06 Thread Stefan Seefeld
What you describe sounds like GCC is getting confused. It may have run into wrong code, but the error message may be caused by a wrong interpretation of what you wanted to do. The fact that things work if you reduce the number of arguments, and the fact that you had to increase BOOST_PYTHON_MAX_

Re: [C++-sig] const shared_ptr and py++ / boost.python

2009-06-06 Thread Roman Yakovenko
On Thu, Jun 4, 2009 at 11:37 PM, Nicolas Regnault wrote: > Dear all: > > I am wrapping a library which relies heavily on boost smart pointers (mainly > boost::shared_ptr< T >). In particular, many functions and methods have > signatures like: > >   void my_func( const boost::shared_ptr< MyClass > &