Re: [C++-sig] pybindgen: Why does pybindgen want to call constructors for a singleton class?

2009-06-22 Thread J. Michael Owen
Ah, I see! That does the trick! Thank you very much. I was clearly confused about what "caller_owns_return" meant -- I had it backwards. Mike. On Jun 22, 2009, at 5:11 PM, Gustavo Carneiro wrote: 2009/6/22 J. Michael Owen I'm looking at wrapping a C++ singleton with pybindgen, and it

Re: [C++-sig] pybindgen: Why does pybindgen want to call constructors for a singleton class?

2009-06-22 Thread Gustavo Carneiro
2009/6/22 J. Michael Owen > I'm looking at wrapping a C++ singleton with pybindgen, and it seems that > if I expose the method for getting the instance to python the generated code > wants to call a copy constructor, which seems wrong to me. If for instance > I define a class "A" as a singleton:

[C++-sig] pybindgen: Why does pybindgen want to call constructors for a singleton class?

2009-06-22 Thread J. Michael Owen
I'm looking at wrapping a C++ singleton with pybindgen, and it seems that if I expose the method for getting the instance to python the generated code wants to call a copy constructor, which seems wrong to me. If for instance I define a class "A" as a singleton: class A { public: static

Re: [C++-sig] wchar_t* type conversion

2009-06-22 Thread Nicolas Lara
Thanks! I'm trying to create an interface for a third party library, so I can't actually change it. I also tried using ctypes.pointer but didn't work either. I'll probably need to create a wrapper that does the type conversion. Thanks again Renato! If anyone knows how to make it work with wchar_t*

Re: [C++-sig] wchar_t* type conversion

2009-06-22 Thread Renato Araujo
Hi Nicolas At my first look I get this working changing the register function: << to_python_converter(); >> to_python_converter(); << static PyObject* convert(wchar_t* const& w) >> static PyObject* convert(wchar_t const& w) <> w

Re: [C++-sig] wchar_t* type conversion

2009-06-22 Thread Nicolas Lara
Hi Renato, Thanks for the reply. Here's some test code. (I pasted it to make it more friendly =) http://paste.pocoo.org/show/124521/ Testing it in python: http://paste.pocoo.org/show/124523/ Thanks in advance! Best Regards For the archives: === test.cpp #include "CLucene.h" #include #include

Re: [C++-sig] wchar_t* type conversion

2009-06-22 Thread Renato Araujo
Hi Nicolas, Can you send a simple example, where the convention fail (c++ to python or python to c++)? What kind of test you are running? BR Renato On Mon, Jun 22, 2009 at 8:31 AM, Nicolas Lara wrote: > Hello, > I'm new to Boost::Python and am encountering a problem that seem to be > quite co

[C++-sig] wchar_t* type conversion

2009-06-22 Thread Nicolas Lara
Hello, I'm new to Boost::Python and am encountering a problem that seem to be quite common: I need to expose a class to C++ whose constructor takes a wchar_t* as a parameter. The problem is that there is no default type converter from wchar_t to python and vice-versa. I wanted to know if there was

[C++-sig] embedding python in C++: exceptions, a newbie Q

2009-06-22 Thread Yuval Nahmany
Hi, I am trying to use boost.python to wrap some classes in an application, and have python embedded in my app and make some instances from the application accessible thru simple script. I got the impression that with boost python it should be quite simple for basics, but I cannot have a simple cod

Re: [C++-sig] Differences between 32-bit and 64-bit python25.lib

2009-06-22 Thread Lars Viklund
On Mon, Jun 22, 2009 at 09:52:35AM +0300, Jesse Lehrman wrote: > It seems that most of the exports in the 32-bit version have a preceding > underscore while in the 64-bit version they don't. For example: > > python25.lib 32-bit: > _PyFloat_AsDouble > > python25.lib 64-bit: >