Re: [C++-sig] Python freezing

2011-11-10 Thread Jay Riley
Well that was easy, Thanks Out of curiosity is there a reason const std::string& doesn't work? Would it just be more trouble then it's worth to support it? > To: cplusplus-sig@python.org > From: d...@boostpro.com > Date: Thu, 10 Nov 2011 22:00:44 -0500 > Subject: Re: [C++-sig] Python freezing >

Re: [C++-sig] Python freezing

2011-11-10 Thread Dave Abrahams
on Thu Nov 10 2011, Jay Riley wrote: > so it seems as though string isn't in the registry? and the error > gets digested silently. This is really weird and I don't quite > understand why returning a string causing a problem. Is it because > it's returned as a const std::string&? Yep. Use a th

[C++-sig] [Boost.Python] How to adjust Python reference counts for hybrid objects?

2011-11-10 Thread Per Knudsgaard
Hi, I have run into a small problem with my understanding of Python reference counts with Python/C++ hybrid objects. I have an abstract interface called A and an associated factory interface called AFactory. I am looking to implement various A+AFactory combinations in both C++ and Pytho

[C++-sig] Python freezing

2011-11-10 Thread Jay Riley
I'm doing some testing on my C++ wrappers, and I'm hitting a point where python just freezes. The debugger stops, no exception is thrown and my program stops responding. I'm not entirely sure what code to show, so if it's not enough, let me know. Here's the python code: class HealingComponent(U

Re: [C++-sig] Converting existing C++ data to python using Boost.Python

2011-11-10 Thread Wojciech Mamrak
Thank you Dave, > If you get the python method into a boost::python::object, you can just > do: > > boost::python::object the_target > the_target.attr("the_method")(foo); > >> Obviously I need to create a Python version of this object. > > Boost.Python can handle that for you behind the scenes

Re: [C++-sig] Converting existing C++ data to python using Boost.Python

2011-11-10 Thread Dave Abrahams
on Thu Nov 10 2011, Wojciech Mamrak wrote: > Hello, > > I am aware about the possibility to register converters to- and from- > Python, which enable the implicit conversions between user-defined and > build-in types in Python. > My question is different: Is it possible to use Boost.Python to > c

[C++-sig] Converting existing C++ data to python using Boost.Python

2011-11-10 Thread Wojciech Mamrak
Hello, I am aware about the possibility to register converters to- and from- Python, which enable the implicit conversions between user-defined and build-in types in Python. My question is different: Is it possible to use Boost.Python to convert existing data structures from C++ to Python? Simple