Niall Douglas wrote:
On 10 Apr 2010 at 21:11, troy d. straszheim wrote:
I see some special handling in invoke.hpp for
boost::python::objects::detail::py_iter_, maybe that has something to do
with it. If one did lock/unlock where I suggest above, one wouldn't
have the necessary c++
troy d. straszheim wrote:
Take function new_class(...) in src/object.cpp: this is called during
BOOST_PYTHON_MODULE(), and invoke.hpp doesn't know about it, therefore
nothing would be locked.
Maybe this is a more practical example:
void set_foo_attr(object& obj, object& w
troy d. straszheim wrote:
Take function new_class(...) in src/object.cpp: this is called during
BOOST_PYTHON_MODULE(), and invoke.hpp doesn't know about it, therefore
nothing would be locked.
During module import that is:
BOOST_PYTHON_MODULE(m)
{
class_("T"); //
Niall Douglas wrote:
On 6 Apr 2010 at 12:14, troy d. straszheim wrote:
Try
http://github.com/ned14/tnfox/blob/master/Python/BoostPatches.zip
which is about two years fresher.
Thanks.
In that patch, why do you (un)lock in invoke.hpp instead of in
static PyObject* function_call
Niall Douglas wrote:
On 4 Apr 2010 at 19:29, troy d. straszheim wrote:
The first main change was to gut a bunch of the old preprocessor gunk
and replace with boost.fusion. This would make my branch incompatible
with Niall's threadsafety changes; on the other hand, it would probably
be
Ravi wrote:
Hi Troy,
On Sunday 04 April 2010 16:16:46 troy d. straszheim wrote:
The boost.python code behind this is
in a separate repository, here:
git://gitorious.org/~straszheim/boost/straszheims-python.git
The code has diverged quite a bit from trunk boost.python by now.
I was only
Christopher Bruns wrote:
On Sat, Apr 3, 2010 at 11:53 AM, troy d. straszheim wrote:
BOOST_PYTHON_MODULE(mod)
{
def("sayhello", as( &sayhello ));
// arg converter ^
};
The as<> might need some clarification
Thanks Troy for the helpful tip.
I
troy d. straszheim wrote:
as(&fn)
where T(U) means "convert the python object to C++ type U, then create a
temporary object T and use it to create result_of::type,
correction, add here "then pass that thing to fn"
> then
convert that type to R and retu
Christopher Bruns wrote:
On Thu, Apr 1, 2010 at 1:32 PM, Michele De Stefano
wrote:
So, as shown into the doxygen example, you have to program a wrapper
like this one:
foo_wrap(boost::python::object pyfile) {
mds_utils::python::oFileObj fobj(py_file);
foo(fobj);
}
That's clever
Michele De Stefano wrote:
there is a much easier way to treat a FILE* as a C++ stream. The easy
way is to use my open source library (mds-utils,
http://code.google.com/p/mds-utils/).
Elegant use of boost::iostreams if I may say so. I've been looking for
some usecases for some boost.python mo
Skip Montanaro wrote:
Do Boost.Python-generated extension modules conform to PEP 384's
constraints for ABI compatibility?
Thanks for pointing that out. Without looking too closely, I doubt that
boost.python conforms.
I'd give it a try, but it looks like I need to wait for python 3.2, then
Alexey Akimov wrote:
2) valgrind - also is pretty convenient tool and produces a lot of
information (the raw output loooks quite difficult to understand, but i
guess there is a play around options). It gives you many options of
profiling.
use kcachegrind to inspect the call graph.
__
Alexey Akimov wrote:
Thank you, Amos
I forget to mention - I am working Linux, so the shark tool probably
will not be suitable for me. But anyway thanks for you reply.
Or this:
valgrind --tool=callgrind mypythonscript.py
kcachegrind
-t
___
Cplusp
Murray Cumming wrote:
On Sun, 2010-02-07 at 22:59 +0100, Murray Cumming wrote:
Is there any easy way to get python Date, Time and DateTime values from
boost::python::objects? In C, I'm using PyDateTime_GET_YEAR(),
PyDateTime_GET_MONTH(), PyDateTime_GET_DAY(), etc, but it would be nice
to use som
Amos Anderson wrote:
Thanks for the responses! It sounds like there's just no way to send a
signal to C++.
Please watch the top-posting...
Moving loops from C++ to Python around is not really a solution for us
because we need to be moving them in the other direction if they're to
be moved at
Anders Wallin wrote:
Hello group,
I have C++ code which uses OpenMP to parallellize some algorithms.
When wrapped with boost-python only one thread seems to run at a time,
and there is no speedup (as seen with pure C++) when using multiple
core machines.
The FAQ says this is pretty much expected
Tim Couper wrote:
OK. Here's what I've been stuck with all today .. I have a 3rd party C++
program function which returns a boost::variant (and its inverse)
my_variant my_variant_of_string(const std::string& str)
This one takes a string & returns a variant, and am trying to wrap this
in pyth
Charles Solar wrote:
Well I want to define the overloads myself anyway, I just do not know
how to properly setup the small wrapper that will work. In the doc it
tells you how to make flat function wrappers, but nothing on member
function wrappers. I am unsure how I am supposed to handle the t
Tim Couper wrote:
I'm trying to boost-python a vector-of-vectors, like
class A
{
public
A(const std::vector>& my_array);
};
and would intuitively write the wrapper:
BOOST_PYTHON_MODULE(foo)
{
using namespace boost::python
class_("A")
.def(init(std::vector >())
;
but get the error
Ravi wrote:
On Friday 06 November 2009 14:52:49 troy d. straszheim wrote:
Currently, the converter type still leaks out to python in the signature:
class S(Boost.Python.instance)
| add(...)
| add( (S)arg1, (object)arg2) -> None :
|
| C++ signat
Renato Araujo wrote:
Hi guys,
I'm trying use the "implicitly_convertible" to specify to boost.python
the possible conversions for every type, but I start get some errors
in my functions call because, the boost.python accept conversions in
more then one level. Like in this code:
The boost.pytho
Dane Springmeyer writes:
> Troy,
>
> Incidentally, do you know the proper way (or is there a proper way?)
> to support None type keyword arguments?
>
> Cheers,
>
> Dane
>
Could you elaborate? What're you trying to do?
-t
___
Cplusplus-sig mailin
Gustavo Carneiro writes:
> Don't you think that when these overloading problems become an issue it is a
> sign of a poorly designed API?
In this case the intention is to fix bugs in boost.python. The broken
example we've been working with is where a parameter is bool in one
overload and int in
Neal Becker writes:
> I am concerned that this doesn't introduce too much overhead for the common
> case where there is no ambiguity. I suppose this has been optimized?
>
For the following module:
int f(int x, int y, int z) { return x*100 + y*10 + z; }
BOOST_PYTHON_MODULE(m) { def("f", &f
Neal Becker writes:
> I assume overload resolution extends to scoring multiple arguments as well?
>
Sure. This is the reason that scores are optional. If any
single argument scorer returns optional() (meaning 'unsuitable'),
this stops evaluation and kills the score for the entire signature.
He
Here's what I've got on overloading. This turned out to be a lot more
work, and this mail much longer, than I'd hoped. Would appreciate a
readthrough and comments/questions, I've done about all I can do. First
a review of the problems, then a walkthrough of an implementation I have
that fixes t
Gennadiy Rozental wrote:
Hi,
Let's say I have string literal as static C++ class member:
string Foo::abc = "ABC";
I'm exporting the class Foo. I'd like to export Foo::abc as well and be able to
access it on Python side using similar interface: Foo.abc.
Can I do this using Boost.Python?
Sur
troy d. straszheim wrote:
That doesn't work for pure python functions either:
>>> def f(x,y,z): return x*100 + y*10 + z
...
>>> from functools import partial as p
>>> p(f,x=1)(2,3)
Traceback (most recent call last):
File "", line 1, in
Type
Neal Becker wrote:
Has anyone noticed that a function created with boost::python using
args() to give keyword arguments doesn't seem to work with
functools.partial keyword arguments (but does with positional args)?
For example, I have this function:
class_
("uniform_real", "Uniform float
Stefan Seefeld wrote:
It's an interesting thought, but it raises a lot of questions, and opens
a huge can of worms. (Welcome in the world of 'DLL hell' !)
I'm not sure what angle to attack this problem from. In particular, I
believe before thinking about interface issues, we should clarify the
Stefan Seefeld wrote:
On 11/20/2009 05:50 AM, Eilif Mueller wrote:
Hi,
I'm using boost.python to interface with some dynamically generated
C++ code, employing some scipy.weave facilities to cache the
results. When I force a recompile and import, I get the following
message:
RuntimeWarning: to
Dimitri Tcaciuc wrote:
Hello everyone,
I've recently posted a problem to SO
(http://stackoverflow.com/questions/1751408/boost-python-opengl-segmentation-faults),
where I haven't had much luck with answer.
My problem is that if I import OpenGL python libraries before
importing my B.P bindings, I
blackmet blackmet wrote:
Hi, everyone.
Prompt me please, how can I connect extern library to bjam.
For example:
connect libd3d9.a from mingw package.
The wrong list I think, asking on you are.
-t
___
Cplusplus-sig mailing list
Cplusplus-sig@p
Thomas Daniel wrote:
BOOST_PYTHON_MODULE(vegetables)
{
class_("Garden")
.def("get_potatoes", &Garden::get_potatoes)
.def("get_tomatoes", &Garden::get_tomatoes)
;
class_("TomatoIter")
.def("__iter__", &TomatoIter::get_next)
;
}
That at least compiles - unlike all
Ravi wrote:
On Saturday 31 October 2009 01:24:16 troy d. straszheim wrote:
I take it that you have a use-case where it is difficult to specify
as(thing)
and easy to specify
as >(thing)
Could you elaborate?
I have some code that takes member function pointers of the form
R
Ravi wrote:
On Wednesday 14 October 2009 21:59:42 troy d. straszheim wrote:
def("plus", as(arg1 + arg2));
This is very cool and pretty intuitive. My main concern is that one needs to
build up the function type in generic code (as opposed to mpl vectors), but we
do have func
Matthew Scouten (TT) wrote:
Yeah. Find the guy who wrote a function with over 25 arguments. Bring
a baseball bat. Persuade him of his error.
+1. "Clue-by-four" time.
-Original Message- From:
cplusplus-sig-bounces+matthew.scouten=tradingtechnologies@python.org
[mailto:cplusplus-si
Eilif Mueller wrote:
Hi,
Wrapping a function f with 16 arguments:
int f(int x1, int x2, int x3, int x4, int x5,
int x6, int x7, int x8, int x9, int x10,
int x11, int x12, int x13, int x14, int x15,
int x16) {
return x1;
}
BOOST_PYTHON_MODULE(test)
{
def("f",f);
}
yi
Ravi wrote:
>
> I'd rather have something along the lines of
> .def< mpl::vector >("f1",f1)
I have something working. There is still a bunch of stuff to iron out
yet. I went with
def("name", as(callable));
where Signature is the signature with which callable will be called,
e.g.
st
Daniel Löb wrote:
Hi!
I seem to be unable to call the constructor of "object" with an integer
parameter.
Working example:
#include
#include
using namespace boost::python;
using std::cout;
using std::endl;
int main()
{
object toast(3);
cout << extract(toast) << endl;
}
It compiles
Ravi wrote:
On Sunday 11 October 2009 19:44:29 troy d. straszheim wrote:
Why is the overloaded get_signature not picked up when it is declared
after the inclusion of the headers?
I'm not sure why it isn't picked up.
Does that mean that you can reproduce the problem I pointed out
Ravi wrote:
[snip]
In order to use a function object in place of a free function, one must
specialize/overload
boost::python::detail::get_signature
which, for some reason, does not account for function objects. Here's a very
simple example that works:
[snip]
However, note that the over
Austin Bingham wrote:
I can't find any documentation re: the "borrowed" nature of obj_ptr,
so I really just assumed that it was a normal, pre-incremented
reference. Any help on this would be great. Thanks.
Here's a good thread on this, thanks to Alex Mohr:
http://mail.python.org/pipermail/cp
Christopher A Mejia wrote:
Stefan,
OK--it's in the system as #3183. Thanks again for your help, and anyone
should feel free to let me know if they need more information about this
issue.
--Chris
Hey Chris,
Steven Watanabe points out that this is due to a hardcoded limit of 24
arguments
I'm going through some bugs, I can't seem to find the thread where this
bug report originated:
https://svn.boost.org/trac/boost/ticket/3450
The fix is on my python branch:
http://gitorious.org/~straszheim/boost/straszheim/commit/a8979df969fd44bfaa649599293ccb173f6c29c7
I haven't closed the
David Roy wrote:
Don't know if some of these additional info is useful...
Not really. Without runnable examples we'd just be guessing.
-t
___
Cplusplus-sig mailing list
Cplusplus-sig@python.org
http://mail.python.org/mailman/listinfo/cplusplus-sig
Nat Goodspeed wrote:
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 st
David Roy wrote:
and the profile was back to 54.0 seconds!!!
Please could someone help me understand what's the difference and the
mechanism underlying that?
Probably that you're not running the code that you think you are. There
should be no difference between member function and free funct
Nicolas Lelong wrote:
You may disambiguate by using a cast inside .def(), such as
.def("getA", (A*(B::*)())B::getA);
Whether that's actually more readable is arguable, however.
IMHO, this is quite dangerous as the explicit cast prevents the compiler
to give you a proper error if the signa
[reply taken offlist]
oops, apparently not, apologies.
-t
___
Cplusplus-sig mailing list
Cplusplus-sig@python.org
http://mail.python.org/mailman/listinfo/cplusplus-sig
Jean-Sébastien Guay wrote:
Hi again Troy,
I was thinking of setting up a googlecode project for this work,
because there is at least one other person who might be interested in
working with me on it (Paul Melis). I'll see if I can do that soon.
It's done now, here:
http://code.google.com/p/
Jean-Sébastien Guay wrote:
Hello Troy,
I've been doing a bunch of work with osg recently. I like it and
badly miss some boost.python bindings. I'd be very interested to
have a look at the code here, maybe pitch in a bit. Is there a git
archive I can clone, and a failing test I can run?
Jean-Sébastien Guay wrote:
Hi all,
Thanks to previous help (a while ago) I was able to make considerable
progress wrapping a pretty complex library (OpenSceneGraph) with
boost.python.
Hey Jean-Sebatien,
I've been doing a bunch of work with osg recently. I like it and badly
miss some boo
Freyr Magnússon wrote:
I trying to create an interface wrapper for a class and I get an error:
cannot convert from 'boost::python::detail::method_result' to
'MMOT::Geometry &'
Checking the code, I see method_result has a workaround for the
conversion-operator-to-reference:
class method_r
Roman Yakovenko wrote:
On Mon, Jul 20, 2009 at 8:51 PM, Matthew Scouten
(TT) wrote:
I would like to second this question.
Right now, I am, with help from other people and from the author
support this suite.
Here(
http://pygccxml.svn.sourceforge.net/viewvc/pygccxml/pyplusplus_dev/indexing_su
Brian O'Kennedy wrote:
After diving deeper into boost.python and python than I felt comfortable
with, I found my own stupid mistake.
On Windows, the presence of _DEBUG causes Py_DEBUG to be defined, but
this is not the case on Linux. When I include boost/python.hpp I need to
define both BOOST_
troy d. straszheim wrote:
Ralf W. Grosse-Kunstleve wrote:
Well, I asked in #python and #python-dev, got referred to
webmas...@python.org, got an autoreply and then silence. Maybe I'll
have to join some python dev lists and shout to find out who runs this
thing. We'll see.
WH
Ralf W. Grosse-Kunstleve wrote:
Since I didn't see any other responses, I'll offer what I know, even though it
doesn't directly answer
your question.
A few years ago I experimented with SWIG - Boost.Python integration, where you
can get easy access
from C++ to SWIG-wrapped objects, inside a fu
r) After writing all that I'm inclined to have a closer
look at the luabind implementation.
-t
Ralf
- Original Message
From: troy d. straszheim
To: Development of Python/C++ integration
Sent: Thursday, March 19, 2009 12:27:56 PM
Subject: Re: [C++-sig] strange behavior wi
I just stumbled on this, which is way out of date:
http://www.python.org/community/sigs/current/cplusplus-sig/
Anybody know how to get it updated?
-t
___
Cplusplus-sig mailing list
Cplusplus-sig@python.org
http://mail.python.org/mailman/listinfo/cpl
mad city wrote:
Thanks. Good advice.
From the quickstart project, the embedded.cpp file function
void exec_file_test(std::string const &script)
{
std::cout << "running file " << script << "..." << std::endl;
// Run a python script in an empty environment.
python::dict global;
troy d. straszheim wrote:
I'm wondering why the current map_indexing_suite is the way it is. Is
there any reason not to enhance it to support now standard methods like
keys(), values(), popitem() and the like?
A colleague and I have been working on an indexing suite that gives a
wrappe
I'm wondering why the current map_indexing_suite is the way it is. Is
there any reason not to enhance it to support now standard methods like
keys(), values(), popitem() and the like?
-t
___
Cplusplus-sig mailing list
Cplusplus-sig@python.org
http://
Ralf W. Grosse-Kunstleve wrote:
The comprehensive solution sounds like a project. Do we have someone to work on
this?
I'm asking because I think Troy's proposed simple solution is better than the
status quo.
I'm willing to work on it. I'd have to look at Daniel W's code to see
if I want t
which function
you're calling:
>> f(float(3), 3)
this seems the most practical to me at the moment. It would break a
bunch of python code , but by adding casts, the old python code could be
made to work with boost.python bindings pre- and post- this change.
-t
troy d. straszhei
I have a quasi-fix for this to the library itself, (see diff below)
buuut it breaks a certain case: if you have a wrapped c++ function that
takes a bool, and you try to pass it an int, you get a
ArgumentError: Python argument types in
builtin_converters_ext.rewrap_const_reference_b
William Marié wrote:
Hi,
I'm looking for a function in boost python ( C++ side ) to do the equivalent
of del dict[key] but i can't find it .
Thank you very much
I think you want:
boost::python::object obj;
obj["where"].del();
-t
___
Cplusplus-
Haoyu Bai wrote:
Hi,
I have posted this to Boost development mailling list before and many
people suggested me to repost here, so I did.
I'm a student who has finished SWIG's Python 3.0 support in GSoC 2008.
I'd like to contribute my knowledge of Python 3 migration to
Boost.Python, by implement
Maik Beckmann wrote:
Considering what Murray done so far, I really doubt he makes this kind of a
mistake. :P
Experts can make this mistake too. I wasn't being condescending. The
error message speaks for itself:
"Boost.Python.class' object is unsubscriptable"
If the problem was what
Maik Beckmann wrote:
Murray Cumming schrieb am Montag 23 Februar 2009 um 12:39:
I'm trying to support this notation in python:
something = record["somefieldname"]
[snip]
I'm now trying to do this with boost::python, like so, because googling
has suggested that this should work:
boost::python:
Hey Leonard,
Here's a short doc about running python scripts that load
boost::python bindings under gdb:
http://software.icecube.wisc.edu/offline-software.trunk/gdb_python.html
In short (i'm guessing this is more or less what you'll need):
gdb --args /usr/bin/python /path/to/my/python/scri
71 matches
Mail list logo