mirror of
https://github.com/boostorg/python.git
synced 2026-01-23 05:42:30 +00:00
str, dict, and tuple!
[SVN r14517]
This commit is contained in:
23
test/tuple.cpp
Normal file
23
test/tuple.cpp
Normal file
@@ -0,0 +1,23 @@
|
||||
#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)
|
||||
;
|
||||
}
|
||||
Reference in New Issue
Block a user