[C++-sig] Re: Retiring the Python/C++-sig mailing list

2025-06-02 Thread Stefan Seefeld
, Jim Bosch via Cplusplus-sig >> wrote: >> >> >> On Wed, May 28, 2025 at 9:23 AM Stefan Seefeld >> wrote: >> >> I agree, but leave it to the list maintainer(s) to take any final >> decision. I'll answer questions here should any be raised. &

[C++-sig] Re: Retiring the Python/C++-sig mailing list

2025-05-28 Thread Stefan Seefeld
I agree, but leave it to the list maintainer(s) to take any final decision. I'll answer questions here should any be raised. On Wed, May 28, 2025 at 9:17 AM Jim Bosch via Cplusplus-sig < cplusplus-sig@python.org> wrote: > This email list has seen almost no real traffic over the past few > years,

Re: [C++-sig] wrap union types with boost.python

2022-01-17 Thread Stefan Seefeld
don't want to post the code directly because it is in house code. Thank you very much, Cheers, Malte On Sun, Jan 16, 2022 at 4:18 PM Stefan Seefeld wrote: Hi Malte, the first step is for you to decide what semantics you want `someStruct` to carry, which would then trans

Re: [C++-sig] wrap union types with boost.python

2022-01-16 Thread Stefan Seefeld
On 2022-01-16 12:29, Malte Dreschert wrote: Hi Stefan, thanks for answering and a greetings from northern Germany to Berlin :) the struct is meant to hold color values (three floats) but the color space can be different. It contains three of these unions and one enum value that contains the

Re: [C++-sig] wrap union types with boost.python

2022-01-16 Thread Stefan Seefeld
Hi Malte, the first step is for you to decide what semantics you want `someStruct` to carry, which would then translate into an API. This is also a prerequisite for using this in pure C++, i.e. without any Python bindings. It just becomes more obvious if you want to think about accessing this

Re: [C++-sig] Boost Python Wrong Python Version macOS

2020-09-07 Thread Stefan Seefeld
Hi Mortimer, On 2020-09-06 12:54 p.m., Mortimer Hemmit wrote: Hi Stefan, Apologies for breaking the reply chain; I wasn't subscribed to the list earlier, so this is the only message I could reply to. Now I should be able to reply to other messages. Thanks for your email. I don't think that ./b

Re: [C++-sig] Boost Python Wrong Python Version macOS

2020-09-05 Thread Stefan Seefeld
Hi Mortimer, I'm myself not a Boost.Build expert, and I try to avoid it if ever I can. But your description sounds as if invoking `./b2` with the option `--with-python=3.7` rather than just `--with-python` would work. (I have no idea what effect those options to `./bootstrap` would have, but

Re: [C++-sig] [boost python] : how to pass a tuple of lists from python to C++

2020-02-08 Thread Stefan Seefeld
On 2020-02-08 12:07 p.m., HOUSSEN Franck wrote: I tried to play with extract::check() without much success : line 13 crashes !?... This is a very simple exemple : would like to get it to work. Could somebody help ? Still googling / searching for a solution You need to call np::initialize() in

Re: [C++-sig] Python support in boost::python (what version)

2019-05-20 Thread Stefan Seefeld
On 2019-05-20 11:20 a.m., Jones, Torrin A (US) wrote: For clarity, my boss is asking, “what version of python does boost python support?”  I was hoping there was some kind of table or something, but I guess the answer is something like, “It supports whatever version of python was out at the

Re: [C++-sig] [Boost-build] Fwd: Re: Boost 1.69 python3 module

2019-02-08 Thread Stefan Seefeld
Steven, I'm not sure the author of the original mail is subscribed to the Boost-build list, so I'm cross-posting your reply. On 2019-02-08 1:56 a.m., Steven Watanabe via Boost-build wrote: AMDG On 2/7/19 6:04 PM, Alex Biddulph via Boost-build wrote: It looks like python was built in that

Re: [C++-sig] distributing libraries built using Boost.Python

2018-10-19 Thread Stefan Seefeld
Hi Danielle, On 2018-10-16 11:41 AM, danielle amethyst brake wrote: Hi Boost.Python friends, I have a library, which consists foremostly of a set of bindings built using Boost.Python, and I am finding distribution to be a barrier.  Requiring the user to build themselves prevents most of my u

Re: [C++-sig] Boost python undef symbols

2018-07-14 Thread Stefan Seefeld
On 07/13/18 08:41, Servando Arboli wrote: > > Dear all, > > I’m trying to install boost python in Windows but I must be doing > something wrong. The execution of b2 with python has produced a > library, but when I’m trying to link I get errors related to undefined > symbols. > >   > > I’ve done a d

Re: [C++-sig] How to derive a python class from a C++ base abstract class [Boost.python]

2018-07-10 Thread Stefan Seefeld
On 2018-07-10 03:55 PM, Danny C wrote: Hi, I am trying to build a hybrid system for exposing my C++ library to python and some other languages. Use case: Expose certain C++ abstract classes to be extended in python. A different exposed concrete class instance uses the methods from extende

Re: [C++-sig] bjam invocation error "rule copyright unknown in module man"

2018-05-05 Thread Stefan Seefeld
On 2018-05-04 12:47 PM, Everest Chen wrote: Hi all, I m following the non-install quickstart guide for a ubuntu 16.04, I had problem at basic procedure step 4 https://www.boost.org/doc/libs/1_66_0/libs/python/doc/html/building/no_install_quickstart.html the command is /example/tutorial$ bj

Re: [C++-sig] How can I get access to "argv/argc" command line in a boost python c++ extension?

2018-01-26 Thread Stefan Seefeld
On 26.01.2018 16:20, Liam Herron wrote: > > So I have a boost python extension C++ library.  I would like to > access the “python commandline” in C++ without having to pass in the > “sys.argv” into my C++ extension.    > > Is there a way to do this?   Include some boost python header and read > it

Re: [C++-sig] Boost.Python and Python limited API

2017-10-10 Thread Stefan Seefeld
On 09.10.2017 16:44, Jason Patton wrote: > Apologies on resurrecting a 7.5 year old topic ( > https://mail.python.org/pipermail/cplusplus-sig/2010-March/015390.html > ) but does anyone else have experience with building Boost.Python with > the limited API (see: https://docs.python.org/3/c-api/stabl

Re: [C++-sig] How to get output from python embedded in VC++

2017-07-23 Thread Stefan Seefeld
On 23.07.2017 03:15, Jian wrote: > > Hi Stefan, > > I still got a assertion failed at Py_Initialize(). Below is the message. > > Program: C:\Python35\python35_d.dll > File: ..\Objects\object.c > Line: 84 > Expression: (op->_ob_prev == NULL) == (op->_ob_next == NULL) And you get this output from th

Re: [C++-sig] How to get output from python embedded in VC++

2017-07-22 Thread Stefan Seefeld
On 21.07.2017 23:17, Jian wrote: > Hi Imre, > > I tried to use boost.python as you advised. Build boost.python with > > But I got a error in the import.hpp as below: > import.hpp start > > namespace boost > { > namespace python >

Re: [C++-sig] How to get output from python embedded in VC++

2017-07-21 Thread Stefan Seefeld
On 21.07.2017 10:03, Jian wrote: > > Then, I have tried this method. It works. I got the text print from > the file. below are the code I used following your advice. > > import sys > original = sys.stdout > sys.stdout = open('redirect.txt', 'w') > ... > other code! > ... > sys.stdout.close() > sys.

Re: [C++-sig] How to get output from python embedded in VC++

2017-07-20 Thread Stefan Seefeld
On 19.07.2017 23:25, Jian wrote: > > Dear Gurus, > > I want to embed python interpreter in my program. What I want is to > redirect those output to a control such as RICHEDIT which can be > modified as a output window in my program. So I can write *.py files > outside of program and invoke it insid

Re: [C++-sig] Convert OpenCV class reference return value

2017-04-04 Thread Stefan Seefeld
Hi Chris, On 03.04.2017 11:58, Chris Schnaufer wrote: > > I have a C++ library where const references to OpenCV types are > returned. Now I’m porting the interface to Python and have hit upon > what looks to be an old issue; there doesn’t appear to be a way to > have boost.python intrinsically con

Re: [C++-sig] Is there anybody has idea about access the set from python?

2017-01-20 Thread Stefan Seefeld
On 19.01.2017 19:48, 奇真亦假 wrote: > Thank you very much. You really do me a lot. > > As I know, it seems that boost::python::set has missed for several years. Right. I'll see whether I can add it for the next release. (Note, though, that this is only a convenience interface. There is nothing you ca

Re: [C++-sig] Is there anybody has idea about access the set from python?

2017-01-19 Thread Stefan Seefeld
On 18.01.2017 23:04, 奇真亦假 wrote: > It's strange that boost::python don't support boost::python::set. Indeed, a wrapper type for that is missing. Feel free to submit a patch. > Set is a very usable structure, so is there any idea about it? How to > convert a python::set to a std::set or any other

Re: [C++-sig] Boost.Python NumPy extension

2016-10-09 Thread Stefan Seefeld
Hi Alex, On 09.10.2016 00:40, Alex Mohr wrote: > Cool! Sorry, I don't have the expertise to help with the boost.build > aspect, but I did have some questions and comments regarding the feature. > > Does this add a dependency of boost.python on numpy? We'd love to be > able to continue use boost.

[C++-sig] Boost.Python NumPy extension

2016-10-08 Thread Stefan Seefeld
Hello, I'm happy to announce that I just merged the NumPy C++ wrappers from https://github.com/ndarray/Boost.NumPy into Boost.Python's development branch. (Online documentation for it can be browsed here: http://boostorg.github.io/python/develop/doc/html/numpy) I'd very much like to be able to me

Re: [C++-sig] Boost Python. access pandas columns in the same order as in python

2016-10-05 Thread Stefan Seefeld
On 04.10.2016 09:05, Vladimir Sakharuk wrote: > > Hello All, > > > Trying to figure out how to c++ access pandas dataframe columns in the > same order as they exist in the python. > > in python: > [...] > || > |//outputs regardless of original order of column names. > //index=0, colname=AA

Re: [C++-sig] Boost Python Question - Multiple Classes and Modules not appearing as attribute

2016-09-09 Thread Stefan Seefeld
On 09.09.2016 10:00, Jon Lederman wrote: > Hi, > > Let me be more explicit: > > If my BOOST thing is: BOOST_PYTHON_MODULE(opus_encoder_strategy) and my > Makefile is like this: > > all: opus_encoder_strategy.so > > opus_encoder_strategy.so: opus_encoder_strategy.o > ${CC} ${CInc} ${CLinkFla

Re: [C++-sig] Boost Python Question - Multiple Classes and Modules not appearing as attribute

2016-09-09 Thread Stefan Seefeld
On 09.09.2016 09:29, Jon Lederman wrote: > Hi, > > Thanks for the response. However, this example doesn’t work for me either if > I set the shared object file to zoo.so. It doesn’t find the animal attribute: > > http://pyengr.readthedocs.io/en/latest/inter/bpy > > Can you explain why? It's impo

Re: [C++-sig] Boost Python Question - Multiple Classes and Modules not appearing as attribute

2016-09-08 Thread Stefan Seefeld
r* encoder; > > int fs; > int channels; > int application; > int error; > > > }; > > > BOOST_PYTHON_MODULE(opus_strategy) > { > using namespace boost::python; > > > class_("OpusEncoderStrategy",

Re: [C++-sig] Boost Python Question - Multiple Classes and Modules not appearing as attribute

2016-09-08 Thread Stefan Seefeld
Hi Jon, what you are describing makes perfect sense, and should work without problem. From your description it isn't clear why this isn't working, so I suggest you put together a self-contained test that doesn't work as you expect, and send that out so we can have a look. Otherwise we'd have to gu

Re: [C++-sig] Segmentation Fault (core dumped) on Python 3.5.2 but not Python 2.7.12

2016-08-04 Thread Stefan Seefeld
Hi Matthew, would you mind submitting an issue on https://github.com/boostorg/python/issues for this. Thanks, Stefan On 04.08.2016 13:10, Matthew Conte wrote: > So I'm trying to create a boost python module that simply creates and > returns a numpy array, > but the function crashes (som

Re: [C++-sig] Testing build of Boost.Python

2016-07-16 Thread Stefan Seefeld
Hi Stephen, On 15.07.2016 16:18, Stephen Wang wrote: > Hello all, > > I have built the Boost.Python libraries with the following options & > configs: > > *bjam ^ > variant=debug,release ^ > link=static,shared ^ > runtime-link=shared --debug-configuration ^ > architecture=x86 address-model=64 ^

Re: [C++-sig] Issue Overriding C++ virtual methods in boost python for use in other C++ functions

2016-07-08 Thread Stefan Seefeld
Hi Liam, On 08.07.2016 15:58, Liam Herron wrote: > > ## > > # THIS DOESN'T WORK > > ## > > > > class MyPySmoothFunction(PyWrapSmoothFunction): > >def __init__(self): > > pass > You need to

Re: [C++-sig] building boost with custom python 3.5 installation

2016-07-06 Thread Stefan Seefeld
Hi Kovas, I suggest you send your question to the boost mailing list, where people with boost.build expertise may be able to help you. I have myself lost track of boost.build, and have therefore added a parallel build system using SCons. Using that you can build boost.python as a stand-alone libr

Re: [C++-sig] Stand-alone Boost.Python

2016-06-20 Thread Stefan Seefeld
On 20.06.2016 04:35, Giuseppe Corbelli wrote: > On Sat, 18 Jun 2016 00:25:08 -0400 Stefan Seefeld > wrote: >> Hello, >> I have started working on a new SCons-based build infrastructure for >> Boost.Python that allows the Boost.Python code to be compiled >> stand

Re: [C++-sig] Getting Boost.Python to explain itself better?

2016-06-18 Thread Stefan Seefeld
Hi Skip, On 17.06.2016 09:37, Skip Montanaro wrote: > I'm trying to debug an assertion error from Boost.Python, but having > no luck. I'm not a C++ programmer, but to my eyes, it seems like my > call should work. I'm using Boost 1.47.0 on an openSuSE 12.2 platform, > with GCC/G++ 4.4. These parame

[C++-sig] Stand-alone Boost.Python

2016-06-17 Thread Stefan Seefeld
Hello, I have started working on a new SCons-based build infrastructure for Boost.Python that allows the Boost.Python code to be compiled stand-alone against a pre-installed Boost. I have checked in a first version to the develop branch, and have enabled Travis-CI to use that. While this works r

Re: [C++-sig] enhancement: Py_DECREF / Py_XDECREF assertion

2016-04-27 Thread Stefan Seefeld
Hi Willi, On 26.04.2016 16:19, Wilfried Karel wrote: > Dear list, > > I suggest to insert an assertion before calling Py_DECREF/Py_XDECREF > which ensures that the reference count before the call is larger than > zero. Otherwise, this means that a PyObject that has already been > destroyed is plan

Re: [C++-sig] Multiple registration safety and unit testing

2016-04-21 Thread Stefan Seefeld
Hi David, I'm just reviewing Boost.Python PRs, and looking at https://github.com/boostorg/python/pull/55 I was reminded of this little exchange. Sorry for having dropped the ball here... On 01.02.2016 17:36, David Sankel wrote: > On Sat, Jan 30, 2016 at 7:30 AM, Stefan Seefeld <

Re: [C++-sig] Trouble building boost with Visual Studio 2010

2016-03-09 Thread Stefan Seefeld
Hi David, On 09.03.2016 05:04, David Aldrich wrote: > > Hi > > > > I am trying to build Boost 1.60 with Visual Studio 2010 Professional > on Windows 10. > > > > I use the command: > > > > b2 toolset=msvc-10.0 --with-python link=shared > > > > and get the following error: > > > > python34

Re: [C++-sig] Problem with and fix for automatic pointer registration in Boost.Python 1.60

2016-03-06 Thread Stefan Seefeld
On 04.03.2016 13:45, Greg Falcon via Cplusplus-sig wrote: > Boost.Python 1.60 has a bug, introducing an incompatibility from 1.59, > and first noted on this mailing list on January 11. What has changed > is that a class declaration of the form > > class_>("Foo"); > > will no longer automatically

Re: [C++-sig] calling python object's method from c++

2016-02-20 Thread Stefan Seefeld
On 19.02.2016 08:10, Sampsa Riikonen wrote: > Dear List, > > I am unable to solve an issue with the python c api (python 2.7). > > Namely, I am trying to pass a python object to c++, where the python > object is then passed to a c++ class that calls the python object's > method.. I only get segment

Re: [C++-sig] Multiple registration safety and unit testing

2016-01-30 Thread Stefan Seefeld
On 29.01.2016 19:19, David Sankel wrote: > Hello all, > > I'd like to allow a class to be registered more than once and wanted > to get your opinion if this change would be a good idea. > > 'boost::python::class_' always adds a class to the current scope and > registers it in the global registry. T

Re: [C++-sig] passing NoneType as argument to constructor

2016-01-29 Thread Stefan Seefeld
On 29.01.2016 13:15, Liam Herron wrote: > > For the following code: > > --- > > #include > > using namespace boost::python; > > > >

Re: [C++-sig] Passing memory allocated in C++ to Python

2016-01-12 Thread Stefan Seefeld
On 12.01.2016 13:54, Tony Cappellini wrote: > > > In your something class, the data type returned from allocate_memory() > > needs to be something that Python understands. Since that allocation > > function (member) will be allocating 100s of MB of memory, how will > > this memory map to a Python d

Re: [C++-sig] Passing memory allocated in C++ to Python

2016-01-12 Thread Stefan Seefeld
On 12.01.2016 12:52, Tony Cappellini wrote: > > Stefan, > > > To: cplusplus-sig@python.org > Subject: Re: [C++-sig] Passing memory allocated in C++ to Python > Message-ID: <56945036.8080...@seefeld.name > > > Content-Type: text

Re: [C++-sig] Passing memory allocated in C++ to Python

2016-01-11 Thread Stefan Seefeld
Hi Tony, On 11.01.2016 17:56, Tony Cappellini wrote: > > > I've already got a project built for Linux, using Boost-python. My > Python code can import the C++ extension and access the members that > are exposed. > > My C++ code needs to call fill in C++ structures in order to call > ioctl() functi

Re: [C++-sig] Beginner - PyObject_CallObject fails because imported module is not recognized

2016-01-06 Thread Stefan Seefeld
Hi Christian, for the sake of simplicity I have transcribed your example to pure Python, which also exhibits the same behavior: #!/usr/bin/env python script = """import pprint import sys counter= 0 def onInitialize(ctxt): global counter counter+=1 pprint.pprint(sys.path) return counter""

Re: [C++-sig] pybind11 -- alternative to Boost.Python

2015-10-19 Thread Stefan Seefeld
On 19.10.2015 06:24, Wenzel Jakob wrote: > I would be open to it but have my doubts about the feasibility of a > merge. Consider the difference in code size alone: Boost.Python > (without dependencies like MPL etc.) uses 26K lines of code, compared > to about 2K for pybind11 (3K with all extensions

Re: [C++-sig] Magic boost conversion unicorn hook?

2015-09-25 Thread Stefan Seefeld
On 24.09.2015 18:36, Ken Seehart (kseehart) [CONT - Type 2] wrote: > > I have a python class that wraps a boost.python object. I am using a > boost.python library function that requires the raw boost.python > object. I want to be able to pass the python object to the boost api > function. > I don'

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

2015-09-18 Thread Stefan Seefeld
On 09/17/2015 05:41 PM, Daniel Brake wrote: > > Hi Boost Python, > > 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 ab

Re: [C++-sig] register c++ std::pair and std::pair

2015-08-28 Thread Stefan Seefeld
On 28/08/15 11:41 AM, MM wrote: > On 28 August 2015 at 16:05, Stefan Seefeld <mailto:ste...@seefeld.name>> wrote: > > On 28/08/15 10:15 AM, MM wrote: > > > > Load 1 then 2 it should trigger the warning. > > Apologies for missing the includes.

Re: [C++-sig] register c++ std::pair and std::pair

2015-08-28 Thread Stefan Seefeld
On 28/08/15 10:15 AM, MM wrote: > > Load 1 then 2 it should trigger the warning. > Apologies for missing the includes. I had to modify your code a bit as it triggers errors when compiled as-is. And with those modifications it didn't see any warning. Could you please post code that I can compile w

Re: [C++-sig] register c++ std::pair and std::pair

2015-08-28 Thread Stefan Seefeld
On 28/08/15 10:15 AM, MM wrote: > > > On 28 August 2015 at 15:01, Stefan Seefeld <mailto:ste...@seefeld.name>> wrote: > > On 28/08/15 09:26 AM, MM wrote: > > This is in too separate modules. > > The converter is registered in module1, and the c

Re: [C++-sig] register c++ std::pair and std::pair

2015-08-28 Thread Stefan Seefeld
On 28/08/15 09:26 AM, MM wrote: > This is in too separate modules. > The converter is registered in module1, and the class_ in > module 2. > I import 1 then 2, then it happens > > Also the intents are different. THe pair is to be > considered as a (str1,str2) tuple of 2 values. > The pair is the [b

Re: [C++-sig] register c++ std::pair and std::pair

2015-08-28 Thread Stefan Seefeld
On 28/08/15 07:49 AM, MM wrote: > > I expose the return type of a C++ function that is a pair of strings > with the following snippet: > > |to_python_converter,Converter>();| > > Later, I have a unrelated C++ range type: > > |typedef std::pairrange_t;| > > which I export as: > > |class_("range").de

Re: [C++-sig] Extracting base object reference of arbitrary Python object

2015-08-18 Thread Stefan Seefeld
Hi Jeremy, I think you have a fundamental misunderstanding of the Boost.Python API, so I suggest you step back a little to first get a better sense of how the mapping between the two languages works: On 18/08/15 04:38 AM, Jeremy Murphy wrote: > > struct Point : public boost::python::object {} > s

Re: [C++-sig] virtual functions with default implementation

2015-08-17 Thread Stefan Seefeld
Hi Alex, On 17/08/15 02:54 PM, Alex Mohr wrote: > On 8/17/2015 11:39 AM, Stefan Seefeld wrote: >> For the case with default implementation, the tutorial gives this >> wrapper: >> >>struct BaseWrap : Base, bpl::wrapper >>{ >> virtual std::str

Re: [C++-sig] virtual functions with default implementation

2015-08-17 Thread Stefan Seefeld
to implement the "default" case directly in the "else" branch above, rather than add it to the "def()" call. Stefan > > On Mon, Aug 17, 2015 at 8:03 AM, Stefan Seefeld <mailto:ste...@seefeld.name>> wrote: > > Hi, > > I'

[C++-sig] virtual functions with default implementation

2015-08-17 Thread Stefan Seefeld
Hi, I'm reviewing the Boost.Python tutorial, and I'm stumbling over the section on "Virtual Functions with Default implementations" (http://boostorg.github.io/python/doc/html/tutorial/tutorial/exposing.html#tutorial.exposing.virtual_functions_with_default_i). It mentions the need to provide a sepa

Re: [C++-sig] express pointer ownership

2015-08-13 Thread Stefan Seefeld
On 13/08/15 06:58 AM, MM wrote: > On 13 August 2015 at 10:24, MM > wrote: > > I have the following class: > > class T { > }; > // T has been exposed to python with class_ > > and free function: > > void add_T( T* ); > > Ownership of the T* i

[C++-sig] Boost.Python docs update

2015-08-05 Thread Stefan Seefeld
Hi all, I have updated the Boost.Python documentation. The new docs are available at http://boostorg.github.io/python. (For any issues you notice please submit a bug report at https://github.com/boostorg/python/issues. Thanks, Stefan -- ...ich hab' noch einen Koffer in B

Re: [C++-sig] Member overloads signature not matching C++ signature

2015-07-31 Thread Stefan Seefeld
On 30/07/15 12:53 PM, James Maddison wrote: > I am trying to bind a C++ class but python is reporting there is no > matching signature for two of the methods which are I am trying to > bind using the member function overloads macro. > > The class looks like so: > > struct path { > path(

Re: [C++-sig] Boost.Python C++ object reference in Python: unexpected behaviour.

2015-06-02 Thread Stefan Seefeld
On 02/06/15 10:36 AM, Christoff Kok wrote: > Hi Stefan, > > Thank you very much. That makes sense and my tests prove it. The code > runs as expected when I reserve enough space for the vector. > > I do not quite get it why it works in C++ and not python. I know too > little about the C++ and python

Re: [C++-sig] Boost.Python C++ object reference in Python: unexpected behaviour.

2015-06-02 Thread Stefan Seefeld
Christoff, I just noticed I wasn't really answering the real problem you report, which is the crash. I believe the problem is in your code: You create two vectors of value-types (cars and factories). Then you take references to the stored objects, while there is no guarantee that the objects' add

Re: [C++-sig] Boost.Python C++ object reference in Python: unexpected behaviour.

2015-06-02 Thread Stefan Seefeld
On 02/06/15 01:34 AM, Christoff Kok wrote: > Hi, > > This looks like a bug in Boost.Python to me. > > Could anyone confirm this? I provided a minimal, full working example. > > I would like to make sure it is a bug before reporting it as one. The 'is' operator compares the identities of the two Py

Re: [C++-sig] C++ copy construction and Python object copies

2015-05-29 Thread Stefan Seefeld
On 29/05/15 06:48 PM, Alex Mohr wrote: > On 5/29/2015 7:28 AM, Stefan Seefeld wrote: >> Python's copy module allows for objects to be copied. The protocol for >> this will look up special method __copy__. It seems to me that this >> would trivially work for C++ objects pr

[C++-sig] C++ copy construction and Python object copies

2015-05-29 Thread Stefan Seefeld
Hello, Python's copy module allows for objects to be copied. The protocol for this will look up special method __copy__. It seems to me that this would trivially work for C++ objects providing a copy-constructor. However, the copy-constructor isn't automatically bound to __copy__. While I can cert

Re: [C++-sig] Boost.Python As Engine's Scripting Language

2015-04-28 Thread Stefan Seefeld
On 28/04/15 02:35 AM, Oam wrote: [...] > How would I make it so it retrieves the TestPiece class for execution > without having to manually create an object on the python side. What I > really want is for the object to exist on the cpp side, but the python > side is what is manipulating it's beha

Re: [C++-sig] Compile C++ to python extension

2015-04-24 Thread Stefan Seefeld
On 23/04/15 04:28 AM, Quentin Blanchon wrote: > Hi, > I'm trying to compile C++ class to a python module extension. > I found a way > here: > http://www.boost.org/doc/libs/1_52_0/libs/python/doc/building.html#configuring-boost-build > > but it doesn't work with versions after boost_1_54, because >

Re: [C++-sig] Boost.Python "contains" compile fix

2015-03-30 Thread Stefan Seefeld
On 30/03/15 04:37 PM, Huebl, Axel wrote: > On 30.03.2015 17:42, Stefan Seefeld wrote: >> On 30/03/15 11:16 AM, Huebl, Axel wrote: >>> Hi, >>> >>> >>> adding more Python 3 features, the "contains" method was added (in 1.55.0?) >>>

Re: [C++-sig] Boost.Python "contains" compile fix

2015-03-30 Thread Stefan Seefeld
On 30/03/15 11:16 AM, Huebl, Axel wrote: > Hi, > > > adding more Python 3 features, the "contains" method was added (in 1.55.0?) > http://www.boost.org/doc/libs/1_55_0/libs/python/doc/news.html > > Unfortunately, I found a nasty compile bug when compiling with nvcc that > I tried to fix in > ht

Re: [C++-sig] Memory management in Boost.Python

2015-03-10 Thread Stefan Seefeld
On 10/03/15 11:24 PM, Ernie Lee wrote: > Hi Stefan, > > I updated my code so it now use 'boost::shared_ptr' class while > specifying the held-type and i got exactly the same errors (i guess > boost did recognize class even in different namespace). > > Any other theories of what could be wrong?

Re: [C++-sig] Memory management in Boost.Python

2015-03-10 Thread Stefan Seefeld
Ernie, it appears what you are seeing is the fact that boost.python only supports boost::shared_ptr, but not std::shared_ptr. (See https://svn.boost.org/trac/boost/ticket/6545). Is it possible for you to switch to Boost's shared_ptr, at least for the Python bindings ? Yes, we need to fix this urge

Re: [C++-sig] passing by non-const reference?

2015-02-19 Thread Stefan Seefeld
On 18/02/15 05:13 PM, Christopher O'Grady wrote: > Hi, > > Based on websearches we have done, we believe that boost-python does > not allow passing arguments by non-const-reference (at least, not > easily). Can someone confirm this is still the case, or point me to > some documentation that discus

Re: [C++-sig] Boost.Python: Review of Patches

2015-02-02 Thread Stefan Seefeld
Axel, I'm trying to look into the open patches to see whether I can help shrink the list of open issues. The issues / patches I have seen from you all look minor / sensible, so I hope I can merge them soon. Still trying to get back up-to-speed with the boost build and test processes etc. I'm subs

Re: [C++-sig] Weird function call results

2014-12-19 Thread Stefan Seefeld
On 18/12/14 06:13 AM, ilias wrote: > I got an overloaded function: > > void f(int n) > { > std::clog << "invoked f(int n = " << n << ")" << std::endl; > } > > void f(double d) > { > std::clog << "invoked f(double d = " << d << ")" << std::endl; > } > > If I put declarations in that order: > > v

Re: [C++-sig] Passing opaque data to C++ callback from Python

2014-12-18 Thread Stefan Seefeld
On 18/12/14 10:43 PM, Peter LaDow wrote: > Thanks for the reply! > > On Thu, Dec 18, 2014 at 9:16 AM, Stefan Seefeld wrote: >> You defined 'do_something' as a callback, and registered it so it could >> be called from C++, yes ? Then, in your implementation of > Y

Re: [C++-sig] Passing opaque data to C++ callback from Python

2014-12-18 Thread Stefan Seefeld
On 16/12/14 11:13 PM, Peter LaDow wrote: > I'm embedding Python (using boost::python) into an application plugin > that uses callbacks. Essentially, I want to do something like: > > In Python (say test.py): > > def do_something(): > ... > > register_callback(do_something) > > And on the C++ side

Re: [C++-sig] Bugs in the Boost.Python tutorial example

2014-11-17 Thread Stefan Seefeld
On 17/11/14 06:54 PM, Alex Mohr wrote: > On 11/17/2014 2:01 PM, Stefan Seefeld wrote: >> (Specifically: I'd be happy to help fix issues with the Boost.Python >> code itself, but I don't feel competent with bjam / Boost.Build, and my >> knowledge of MSVC is almost no

Re: [C++-sig] Bugs in the Boost.Python tutorial example

2014-11-17 Thread Stefan Seefeld
On 17/11/14 04:50 PM, Jim Bosch wrote: > On Mon, Nov 17, 2014 at 4:35 PM, Michael Rolle > wrote: > > > > Are you the one responsible for maintaining / bug fixing for > Boost.Python? Or would I assume someone else will see my post and > act on it? Actua

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

2014-10-28 Thread Stefan Seefeld
On 28/10/14 06:46 AM, Wintersberger, Eugen wrote: > Hi Stefan > > On Fri, 2014-10-24 at 07:12 -0400, Stefan Seefeld wrote: >> >>>> Alternatively you could try to reduce the >>>> dependency to only exist at the Python interface level, such that using

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

2014-10-24 Thread Stefan Seefeld
On 23/10/14 10:33 AM, Wintersberger, Eugen wrote: > Hi Stefan > >> Python extension modules may not depend on each other in that way. >> (Arguably that is a Good Thing, as it avoids possible ABI compatibility >> issues.) >> What I suggest you do is either refactor the code such that your >> exte

Re: [C++-sig] Exposing simple polymorphism with boost python

2014-10-24 Thread Stefan Seefeld
On 23/10/14 03:38 AM, Erik Türke wrote: > Hi Python-Experts :-) > > > i am starting to get really frustrated trying to expose a simple C++ > polymorphism to python with boost::python. > I do have the following structure in C++: > > struct Base { > int typeID; > }; > > struct Der

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

2014-10-23 Thread Stefan Seefeld
On 22/10/14 08:08 AM, Wintersberger, Eugen wrote: > Hi there > I have a little problem with two Python extensions (C++ with > boost::python) where share code. An example of what I am trying to do is > attached to this mail so I will refer to the code in the tarball to > explain the problem. > >

Re: [C++-sig] boost python class member getter/setter same name different only by constness

2014-10-03 Thread Stefan Seefeld
On 2014-10-03 12:56, MM wrote: > yes i did that. > > class C { > public: > const std::string& get_name() const; > void set_name(const std::string&); > private: > std::string name_; > }; > > > > class_("C"). > .add_property("name", &C::get_name, &C::se

Re: [C++-sig] boost python class member getter/setter same name different only by constness

2014-10-03 Thread Stefan Seefeld
On 2014-10-02 16:09, MM wrote: > Hi > > class C { > public: > const std::string& name() const; > std::string& name(); > private: > std::string name_; > }; > > given this class C, how would I expose it to python with the class > property name? > > class_("C"). > .add_property("name", &C::n

Re: [C++-sig] Building Boost with python2.7 libraries on centos 6.5

2014-09-10 Thread Stefan Seefeld
On 09/09/2014 06:19 PM, Whitmore, Mattie [USA] wrote: > Dear All, > > I must build boost 1.46.1 from source since yum does not support it. I > am running into issues with the proper make commands. I have run: > > > ./bootstrap.sh -with-libraries=python -with-python=Python2.7 > -with-toolset=gcc > >

Re: [C++-sig] Boost python extract on Mac OS Mavericks - seg fault

2014-08-30 Thread Stefan Seefeld
On 08/28/2014 06:19 PM, Brian Bruggeman wrote: > Hi all, > > I am having trouble with a really simple example, and I am hoping > someone on this list can help me. > > I have created a github repo for code in question: > > git clone g...@github.com:brianbruggeman/boost_python_hello_world.git > > I h

Re: [C++-sig] Exposing a generic template system in Boost.Python

2014-03-19 Thread Stefan Seefeld
Francesco, I have done something like what you are suggesting. It essentially boils down to defining a function template like template void define_vector(char const *name) { class_<...> vector(name); ... } and then calling that multiple times: define_vector("IVector"); define_vector(

Re: [C++-sig] create a python object from scratch in boost.python?

2014-01-21 Thread Stefan Seefeld
On 01/21/2014 05:24 PM, Gary Oberbrunner wrote: > > - Original Message - >> From: "Stefan Seefeld" >> Have a look at the attached code; I don't think that counts as >> heavy-weight. In particular, trying to do the same without embedding >

Re: [C++-sig] create a python object from scratch in boost.python?

2014-01-21 Thread Stefan Seefeld
On 01/21/2014 01:52 PM, Gary Oberbrunner wrote: > > - Original Message - >> From: "Stefan Seefeld" > ... >> It seems what you really want is a way for your C++ code to >> manipulate pure Python objects, without any automatic type conversion. >

Re: [C++-sig] create a python object from scratch in boost.python?

2014-01-21 Thread Stefan Seefeld
On 01/21/2014 11:03 AM, Gary Oberbrunner wrote: > > - Original Message - >> From: "Stefan Seefeld" >> To: "Development of Python/C++ integration" >> Sent: Tuesday, January 21, 2014 10:45:52 AM >> Subject: Re: [C++-sig] create a python o

Re: [C++-sig] create a python object from scratch in boost.python?

2014-01-21 Thread Stefan Seefeld
On 01/21/2014 10:37 AM, Gary Oberbrunner wrote: > So now it returns a python list of python dicts. All I want now is to > override __getattr__ on each ppinfo dict so it returns the dict value > as the attribute value, so in python I can reference > effect_list[i].name instead of effect_list[i]['nam

Re: [C++-sig] problem embedding python - very simple example

2012-11-06 Thread Stefan Seefeld
On 11/06/2012 02:40 PM, Cory Riddell wrote: > It prints "hello\nworld\n" then throws an exception executing the line > that creates the hello.txt file: > First-chance exception at 0x755ac41f in Test.exe: Microsoft C++ > exception: boost::python::error_already_set at memory location 0x0039fb60.. >

Re: [C++-sig] [boost.python] Can't import a wrapped template class

2012-10-26 Thread Stefan Seefeld
On 10/26/2012 04:15 PM, Paul O. Seidon wrote: > Yes, I have to provide a TYPE to the tempate to enable the compiler to > generate code. Isn't > > typedef _Variable VariableDouble; > > BOOST_PYTHON_MODULE(_varbls) > { > > class_("VariableDouble") > .def( init<>()) > .def( ini

Re: [C++-sig] [boost.python] Can't import a wrapped template class

2012-10-26 Thread Stefan Seefeld
On 10/26/2012 02:24 PM, Paul O. Seidon wrote: > Paul O. Seidon wrote: > > That doesn't do it either. I can't help but post the compete code here to be > sure I'm not misunderstood. The lib consists of varbls.cpp and varbls.h and > the wrapper main.cpp. > varbls.cpp > == > > #include "va

Re: [C++-sig] [boost.python] Can't import a wrapped template class

2012-10-26 Thread Stefan Seefeld
On 10/26/2012 02:16 PM, Paul O. Seidon wrote: > Stefan Seefeld wrote: > >> On 10/26/2012 01:50 PM, Paul O. Seidon wrote: >>> The ctor is decl'ed in varbls.h as >>> >>> _Variable(); >>> >>> and it's def'ed in varbls.c

Re: [C++-sig] [boost.python] Can't import a wrapped template class

2012-10-26 Thread Stefan Seefeld
On 10/26/2012 01:50 PM, Paul O. Seidon wrote: > The ctor is decl'ed in varbls.h as > > _Variable(); > > and it's def'ed in varbls.cpp like so: > > template > _Variable::_Variable() > : _value( 0) > { > //ctor > } That doesn't work. When the compiler compiles varbls.cpp, it doesn't know what

Re: [C++-sig] [boost.python] Can't import a wrapped template class

2012-10-26 Thread Stefan Seefeld
On 10/26/2012 07:42 AM, Paul O. Seidon wrote: > Hi all, > > right now I'm doing my first stepps in wrapping C++ code by ude of Boost. [...] Where is the definition of your _Variable template instances ? Your newly compiled Python module can't find them. The likely cause is that you forgot to link

  1   2   3   >