mirror of
https://github.com/triqs/dft_tools
synced 2024-12-26 14:23:38 +01:00
f2c7d449cc
for earlier commits, see TRIQS0.x repository.
22 lines
478 B
C++
22 lines
478 B
C++
#include <Python.h>
|
|
#include <boost/python.hpp>
|
|
|
|
namespace triqs { namespace python_tools {
|
|
|
|
// A simple wrapper
|
|
class boost_object {
|
|
|
|
boost::python::handle<> hdl;
|
|
|
|
public:
|
|
|
|
boost_object(PyObject * py_ob) : hdl(boost::python::borrowed(py_ob)) {}
|
|
|
|
operator boost::python::object () { return boost::python::object(hdl); }
|
|
operator boost::python::list () { return boost::python::list(hdl); }
|
|
operator boost::python::dict () { return boost::python::dict(hdl); }
|
|
|
|
};
|
|
|
|
}}
|