Re: [C++-sig] formatting str of exposed type

2015-09-18 Thread Nat Goodspeed
On Thu, Sep 17, 2015 at 5:41 PM, Daniel Brake wrote: > I would like a C++ class which I am exposing through Boost.Python > (initially,the boost::multiprecision::mpfr_float, with expression templates > turned off -- eventually a whole pile of types depending on mpfr_float) to > be able to respon

Re: [C++-sig] sharing code between different python extensions

2014-10-23 Thread Nat Goodspeed
On Oct 22, 2014, at 8:08 AM, "Wintersberger, Eugen" wrote: > I have a little problem with two Python extensions (C++ with > boost::python) where share code. > > I have to Python extensions ('a' and 'b') each of them exporting two > functions. What I want is to use a function exported by 'a' i

Re: [C++-sig] V2 windows build problems update

2013-10-20 Thread Nat Goodspeed
On Sat, Oct 19, 2013 at 4:50 AM, Nitas Aeter wrote: fatal error LNK1104: can not open “libmmdd.lib” > > Can you help me ? > Wow, that's really not a lot to go on. Usually the mailing list would at least want to know what you're trying to do, what versions of the OS and compiler you're using and w

Re: [C++-sig] Boost Python support Python Version.

2012-07-23 Thread Nat Goodspeed
On Jul 22, 2012, at 4:20 AM, Harkirat Singh wrote: > My target system uses python2.4.4. > I have even tried swig, but it seems there isnt full support for python2.4. > It uses some python c++ API not supported in > python2.4.4. My advice would be to update your Python version. Quite aside from

Re: [C++-sig] Fwd: Passing Python-derived class back into a native C++ class doesn't match the C++ signature

2011-11-12 Thread Nat Goodspeed
On Nov 12, 2011, at 2:25 PM, Jim Bosch wrote: > On 11/12/2011 02:12 PM, Adam Preble wrote: >> Woooah that looks like it does work, although I had to interpret it like so: >> >> class DerivedTest(BaseTest): >> def __init__(self): >> BaseTest.__init__(self) Yes, sorry the email quoting conf

Re: [C++-sig] Fwd: Passing Python-derived class back into a native C++ class doesn't match the C++ signature

2011-11-12 Thread Nat Goodspeed
On Nov 12, 2011, at 11:34 AM, Adam Preble wrote: > I am seeing this come up in many variations, with people doing slightly > different things. I have no direct experience with this issue myself, but I can parrot a bit of advice I've read here before. > In Python: > class DerivedTest(BaseTest

Re: [C++-sig] failed to install boost.python on Lion

2011-10-26 Thread Nat Goodspeed
On Oct 26, 2011, at 9:54 AM, Liguo Kong wrote: > I am trying to install boost.python on Mac Lion OS. I used python 2.6 > installed by default and > built boost.build with ./bootstrap.sh --set-toolset=gcc and then ./b2 install > --prefix=~/workspace/boost_build. Uh, maybe toolset=darwin?___

Re: [C++-sig] Boost.Python: Callbacks to class functions

2011-08-01 Thread Nat Goodspeed
On Aug 1, 2011, at 10:50 AM, diego_pmc wrote: > How should I capture Python function objects such > that I won't increase their reference count? I only need a weak reference to > the objects. http://docs.python.org/library/weakref.html#module-weakref I don't know how to access a Python weakref

Re: [C++-sig] Linking issues with Boost.Python

2010-08-18 Thread Nat Goodspeed
David Aldrich wrote: I would strongly recommend that you use something more modern than GNU make. Boost's build system is much better. The one I use is scons (http://www.scons.org/) whose only main fault is O(N^2) scaling to source file number, a problem they are in the process of fixing. Shou

Re: [C++-sig] Calling a C++ function with arguments by reference (lvalues)

2010-08-02 Thread Nat Goodspeed
Oded Padon wrote: There is another reason why I think this has to be possible. > It is possible using ctypes. Using ctypes with the same C++ > code written above (except for extern "C"), the following python code: import ctypes; lib_cpp = ctypes.CDLL('./test_cpp.so') result = ctypes.c_int(0);

Re: [C++-sig] Calling a C++ function with arguments by reference (lvalues)

2010-08-02 Thread Nat Goodspeed
Oded Padon wrote: The C++ code is: void add(int const a, int const b, int const& c) { c = a + b; } This doesn't even compile under g++ 4.0.1 (Mac): error: assignment of read-only reference 'c' I hope you're not using a compiler that accepts such code as legal? I must emphasize that I w

Re: [C++-sig] interfacing headle binary file library, raw pointer and buffer

2010-06-20 Thread Nat Goodspeed
hero...@gmail.com wrote: I am trying to interface a binary file library using py++. There is a function in the library like int read(void* buffer, size_t len) which is hard to wrap. It read a piece (size len) of the file, and store it in buffer, and then return the buffer length (most l

Re: [C++-sig] When not to use static boost python library

2010-05-12 Thread Nat Goodspeed
Mr Kun Hong wrote: The lines in the documentation is: ''' It might be appropriate to use the static Boost.Python library in any of the following cases: * You are extending python and the types exposed in your dynamically-loaded extension module don't need to be used by any other Boost.

Re: [C++-sig] [Py++] boost::shared_ptr casting

2010-03-21 Thread Nat Goodspeed
peoro wrote: There should be no need of dynamic_cast or any kind of run time type checking since the program has got static knowledge of types: The C++ program may have that knowledge. All I'm saying is that your original issue concerned Python determining the runtime type (leaf class) of e

Re: [C++-sig] [Py++] boost::shared_ptr casting

2010-03-21 Thread Nat Goodspeed
peoro wrote: Ok, it does work as expected if class Base has got at least one virtual member: ...What if I cannot add a virtual function to the class Base? If your C++ base class has no virtual methods, even pure C++ can't dynamic_cast<> it. Put differently -- you've been asking Python to d

Re: [C++-sig] How to install extensions using bjam(?)

2009-10-22 Thread Nat Goodspeed
Amos Anderson wrote: I'm working on a project which is mixed C++/Python, and we use Boost functionality in our C++, and we've set up bjam to compile our project (on OSX). Everything seems to be working quite well. 2) It looks like python's distutils is supposed to be able to help, but it seems

Re: [C++-sig] Conversion from Python to C++

2009-10-02 Thread Nat Goodspeed
Michele De Stefano wrote: I'd like to write a custom from_python converter, but the point is that I've not understood how it works. Did you see Austin Bingham's recent post on another thread? If it's any help, I wrote a small bit on the details of writing converters. It might help clarify so

Re: [C++-sig] Subset of default python library

2009-09-10 Thread Nat Goodspeed
Mark Chandler wrote: Is there a small subset of the default python library that i can use for our embedded instance. Since this is part of a larger app that doesnt expect to have python installed thus we are including it with the program data. How ever there is alot of stuff in there that we a