mirror of
https://github.com/boostorg/python.git
synced 2026-01-20 04:42:28 +00:00
24 lines
451 B
C++
24 lines
451 B
C++
#include <boost/python/module.hpp>
|
|
#include <boost/python/class.hpp>
|
|
#include <boost/python/tuple.hpp>
|
|
|
|
using namespace boost::python;
|
|
|
|
object convert_to_tuple(object data)
|
|
{
|
|
return tuple(data);
|
|
}
|
|
|
|
void test_operators(tuple t1, tuple t2, object print)
|
|
{
|
|
print(t1 + t2);
|
|
}
|
|
|
|
BOOST_PYTHON_MODULE_INIT(tuple_ext)
|
|
{
|
|
module("tuple_ext")
|
|
.def("convert_to_tuple",convert_to_tuple)
|
|
.def("test_operators",test_operators)
|
|
;
|
|
}
|