It looks like boost::python::extract::check() will happily succeed
on an int python object, and boost::python::extract::check() will
likewise succeed on a bool python object.
Is there an easy way to discover the actual python type so I can really
get the data I want in the correct type?
--
murr.
I tried running pydoc on my python module,
(implemented here
http://git.gnome.org/browse/glom/tree/glom/python_embed/python_module/py_glom_module.cc#n35
)
but the output has lots of stuff that is uninteresting to Python coders,
even after using docstring_options. For instance:
http://www.murrayc.co
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
On Fri, 2009-02-27 at 15:18 -0800, Alex Mohr wrote:
[snip]
> If you have a PyObject *p and you want a bp::object,
> construct it via:
>
> object(handle<>(p)) // when p's a new reference
I find that I have to split the handle and object over two lines. If I
do this
boost::python::obj
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 some C++ API for this.
--
murr...@murrayc.com
www.murrayc.com
www.openismus.com
__
On Sun, 2010-02-07 at 09:51 -0500, Stefan Seefeld wrote:
>
> Sorry, I don't understand the question. Can you give an example of
> what
> you want to do ? May be you want to "exec" some python code that
> defines
> a function, which you then want to extract and call later ?
> That may look like t
On Sun, 2010-02-07 at 08:03 -0500, Stefan Seefeld wrote:
> On 02/07/2010 05:22 AM, Murray Cumming wrote:
> > In Glom, to execute arbitrary Python code, I use PyRun_String() to parse
> > the Python code, PyDict_GetItemString() and PyObject_Call() to get a
> > callable object fo
Doing this
boost::python::object obj = get_some_object();
if(obj)
{
//do something
}
seems to check a bool value inside the underlying PyObject, though I
guess that could throw an exception if it doesn't contain actually
contain a bool. Is that right?
The reference documentation is not
In Glom, to execute arbitrary Python code, I use PyRun_String() to parse
the Python code, PyDict_GetItemString() and PyObject_Call() to get a
callable object for that code, and then PyObject_CallObject() to
actually execute the code and get a return value. This was the result of
experimentation and
On Sat, 2010-02-06 at 12:54 -0500, Stefan Seefeld wrote:
> On 02/06/2010 08:39 AM, Murray Cumming wrote:
> > If I have a boost::python::object that I know contains a PyObject that
> > wraps an instance of my C++ class, MyClass, can I get a pointer to that
> > MyClass instance
If I have a boost::python::object that I know contains a PyObject that
wraps an instance of my C++ class, MyClass, can I get a pointer to that
MyClass instance, so I can call its C++ methods?
--
murr...@murrayc.com
www.murrayc.com
www.openismus.com
___
Can someone confirm that this is correct:
1.
To get a boost::python::object that wraps an existing PyObject* (when
you get a PyObject from a C function not wrapped in boost::python), can
someone confirm that this is correct:
Either:
a)
PyObject* c_object = get_the_c_object(); //returns a referen
Is there any version of the boost::python API that doesn't use
exceptions? I have an environment that disables exceptions in the C++
compiler, but I'd like to use boost::python there.
--
murr...@murrayc.com
www.murrayc.com
www.openismus.com
___
Cpluspl
On Fri, 2009-02-27 at 08:34 -0800, Alex Mohr wrote:
> Murray Cumming wrote:
> > I can't find any definitive documentation that tells me how I should get
> > a boost::python::object to wrap an existing PyObject*. I guess that
> > there's a way to do it that uses a
t*. I guess that
> there's a way to do it that uses an existing reference, and a way that
> takes an extra reference.
>
--
Murray Cumming
murr...@murrayc.com
www.murrayc.com
www.openismus.com
___
Cplusplus-sig mailing list
Cplusplus-si
I can't find any definitive documentation that tells me how I should get
a boost::python::object to wrap an existing PyObject*. I guess that
there's a way to do it that uses an existing reference, and a way that
takes an extra reference.
--
murr...@murrayc.com
www.murrayc.com
www.openismus.com
_
On Mon, 2009-02-23 at 19:38 +0100, Maik Beckmann wrote:
> troy d. straszheim schrieb am Montag 23 Februar 2009 um 19:15:
> > > Murray Cumming schrieb am Montag 23 Februar 2009 um 12:39:
> > >> I'm trying to support this notation in python:
> > >> somet
"Boost.Python.class' object is unsubscriptable"
Is there something else that I need to do?
--
Murray Cumming
murr...@murrayc.com
www.murrayc.com
www.openismus.com
___
Cplusplus-sig mailing list
Cplusplus-sig@python.org
http://mail.python.org/mailman/listinfo/cplusplus-sig
18 matches
Mail list logo