2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-22 17:32:55 +00:00

Merge Trunk changes to RC_1_29_0

[SVN r15732]
This commit is contained in:
Dave Abrahams
2002-10-05 12:53:06 +00:00
parent 0462c4d2f4
commit c33ac6b47a
154 changed files with 4121 additions and 9390 deletions

View File

@@ -9,22 +9,15 @@ namespace { // Avoid cluttering the global namespace.
int square(int number) { return number * number; }
}
#include <boost/python/class_builder.hpp>
#include <boost/python/module.hpp>
#include <boost/python/def.hpp>
namespace python = boost::python;
// Python requires an exported function called init<module-name> in every
// extension module. This is where we build the module contents.
BOOST_PYTHON_MODULE_INIT(getting_started1)
BOOST_PYTHON_MODULE(getting_started1)
{
try {
// Create an object representing this extension module.
python::module_builder this_module("getting_started1");
// Add regular functions to the module.
this_module.def(greet, "greet");
this_module.def(square, "square");
}
catch(...) {
boost::python::handle_exception();
}
python::def("greet", greet);
python::def("square", square);
}