Hi Alex,
On Wed, 07 Aug 2013 18:06:24 +0100, Alex Mohr wrote:
Thanks for your response. I've responded to your comments in-line below.
After further investigation, I believe this can be fixed by simply
checking for None when we get 'kv' from f->m_arg_names while resolving
keywords. If w
Hi,
On Wed, 07 Aug 2013 01:35:54 +0100, Alex Mohr wrote:
I'm hitting a repeatable segfault trying to upgrade our boost version. I
believe there may be a bug with overload resolution in the presence of
keyword arguments. Here's a minimal example that crashes for me.
// C++
#include
stat
On Fri, 14 Jun 2013 12:57:48 +0100, Neal Becker
wrote:
I have a class that has a member
something like this:
class A {
boost::shared_ptr b;
};
boost::shared_ptr get_b (A const& ...) {
return A.b;
}
where class B is already exposed to python in a different module.
I think this depe
I had a similar problem when testing my extensions on OSX. I guess you're not on OSX, but if you test out on it, I'm sure you'd find even more linking problems.. Problem is that the bundle format - the default Python extension format, on OSX - doesn't allow compile-time linking, only run-time dyna
On Wed, 12 Jun 2013 11:34:24 +0100, Holger Brandsmeier
wrote:
Trevor,
ok, so I misunderstood your question. If what you want to do is this:
myclass.h
class MyClass {
[...]
};
pythonFile.cpp
#include "myclass.h"
[...]
BOOST_PYTHON_MODULE(...) {
[...]
}
That is certainly possible
On Sun, 02 Jun 2013 21:04:51 +0100, Александров Петр
wrote:
02.06.2013 13:14, Alex Leach пишет:
1. Boost Python has a dedicated exception handling API[1] that
doesn't require you to wrap the exception in a class_<> template. The
class_ template is a bit heavy duty for
On Sat, 01 Jun 2013 23:50:40 +0100, Александров Петр
wrote:
I want to catch a custom C++ exception in Python. I have described my
custom exception class as usual:
class_(...);
and created a translator:
void translate(CMyException const &e) {
object o(e);
PyErr_SetObject(PyExc_E
On Thu, 09 May 2013 07:41:49 +0100, Wichert Akkerman
wrote:
If I try to do that by adding this:
to_python_converter();
to_python_converter()
I get a compile error:
/opt/local/include/boost/python/converter/as_to_python_function.hpp:21:84:
error: 'type name' declared as a pointer to a
On Thu, 09 May 2013 07:55:07 +0100, Wichert Akkerman wrote:On May 8, 2013, at 23:31 , "Alex Leach" <beamesle...@gmail.com> wrote:That error means the type_id of uuid is not in the bp registry.I think you can fix this by deriving uuid_to_python from to_python_converter, as dem
That error means the type_id of uuid is not in the bp registry.I think you can fix this by deriving uuid_to_python from to_python_converter, as demonstrated in the pytype_function example[1]. This will add the get_pytype function call, and on initialisation, should hopefully add what's missing: a
Dear list,
A thread I started was originally meant to discuss how to use C++ memory
management methods (operator new, delete etc.) with a boost python
instance. Rather than dwelling on the concern, I've been (successfully)
wrapping other code since, but have now arrived at a separate conund
Hi again,
Whilst hoping for a reply, I thought I'd add some further insights I've
learnt about the current PyTypeObject scheme.
On Thu, 18 Apr 2013 17:14:05 +0100, Jim Bosch
wrote:
I was originally thinking that maybe you could get away with
essentially wrapping your own classes just using
Hi,
Thanks again for the fast response!
On Thu, 18 Apr 2013 17:14:05 +0100, Jim Bosch
wrote:
You can't really register the types themselves. All you can do is
register custom converters for them, i.e. You'll need to read the code
and comments in the "converter" subdirectories of the B
Thank you for the quick response!On Thu, 18 Apr 2013 15:24:09 +0100, Jim Bosch wrote:If you go with writing your own PyTypeObject, you will indeed have a lot more control, but it will greatly limit how much Boost.Python you can use (no class_, for instance, at least), and you'll need to dive deep
Dear list,
Apologies if this has been asked before, but I'm struggling to find
anything strictly related..
Background
--
This library I'm trying to wrap uses its own memory management model,
where almost every class derives from an object with loads of memory
management-related m
The iterator I'm wrapping comes from a 3rd party library, over which I have
no control. However, I have been able to add those missing types to the
derived inheritor class, by also inheriting from 'iterator_facade', as per
a suggestion on StackOverflow.
Thanks for the reply btw; I have no clue when
On Wed, 27 Mar 2013 11:36:47 -, Alex Leach
wrote:
I'm trying to wrap an iterable class, which returns a custom iterator
typedef'd as const_iterator, from its begin and end methods.
In case any of you like answering these types of questions on
StackExchange sites, I'
Hi,
I'm trying to wrap an iterable class, which returns a custom iterator
typedef'd as const_iterator, from its begin and end methods.
When using boost::python::(iterator|iterators|range) to create an iterator
in the exposed __iter__ function in the exposed class_ def, I get a load
of com
Thanks for the reply, and apologies for the delay in mine; I've been
struggling with classes having protected destructors. Sorted now though..
On Sat, 23 Mar 2013 03:02:58 -, Niall Douglas
wrote:
Separate C++ objects from their python wrappers. Have C++ objects
held by shared_ptr.
H
On Wed, 20 Mar 2013 15:52:52 -, Jim Bosch wrote:
http://www.boost.org/doc/libs/1_53_0/libs/python/doc/v2/faq.html#threadsupport
There are other people on this list who know a lot more about this than
I do, but my understanding has always been that it you use Boost.Python
with threadin
On Wed, 20 Mar 2013 19:28:35 -, Jeffrey Van Voorst
wrote:
In short, the boost smart pointers, boost spirit, etc. implementations
vary depending on the compile time options. I don't know if
boost.python has options.
Hi again,
So I've just rebuilt everything to be compatible with Pyt
On Wed, 20 Mar 2013 19:28:35 -, Jeffrey Van Voorst
wrote:
This could be misinformation, but some of the boost libraries have
compile time flags that depend on whether or not threading is enabled.
As an example, I was running into issues with an invalid free() with
respect to shared_
On Wed, 20 Mar 2013 19:27:34 -, Jim Bosch wrote:
(btw, this reply seemed to only go to me rather than the list)
oh, sorry... Need to get into a habit of double-checking the reply
address..
On 03/20/2013 02:16 PM, Alex Leach wrote:
void PyEnv::ResetPyList(const boost::python::list
On Wed, 20 Mar 2013 15:52:52 -, Jim Bosch wrote:
http://www.boost.org/doc/libs/1_53_0/libs/python/doc/v2/faq.html#threadsupport
Thanks for that link. I checked out the tnfox library, which the FAQ
refers to as having a thread-safe implementation of invoke.hpp. tnfox,
whatever it is,
On Wed, 20 Mar 2013 16:53:55 -, Alex Leach
wrote:
I've put it in a "boost_helpers" folder in my own project, but I'd be
perfectly happy if someone wanted to put it in mainline boost. I attach
it here, if you're interested in having it ;)
Sorry, forgot t
Thanks for your replies!
On Wed, 20 Mar 2013 16:34:00 -, Jim Bosch wrote:
I don't think shared_ptr would help here (and you almost certainly don't
want to inherit from it), though I'm curious what you're using to wrap
std::list, as you clearly have methods that return std::list, and t
On Wed, 20 Mar 2013 15:54:45 -, Jaedyn K. Draper wrote:
Can you send the C++ code of MyObj? Kind of hard to diagnose a
C++-side crash without any C++ code.
Sure. Sorry, thought previous email was getting long and it might have been an obvious fix for someone... Just writing a
Hi,
I was wondering the best way to solve this problem:-
void WrapperClass::parse_args(boost::python::list argv)
{
int argc = boost::python::len(argv);
const char* const* pargv = boost::python::extractconst*>(argv); /// <
WrappedClass::parse_args(argc, pargv);
}
This doesn't wo
Dear list,
I've started using Boost.Python to wrap a 3rd party C++ library, and
whilst running my unit tests, the Python interpreter segfault's during
garbage collection.
With explicit object deletion:
$ gdb -q --args python -c 'import mylib; obj = mylib.MyObj(); del(obj)'
...
*** Error in
29 matches
Mail list logo