mirror of
https://github.com/boostorg/python.git
synced 2026-01-27 07:02:15 +00:00
* object(f), where f is a function pointer now works. Returning a
* function pointer from a function should work also. * make_function/make_constructor now return object instead of a raw pointer. * module::setattr() now accepts anything which can be passed to object's constructor. * Rework upcast<> to catch more errors at compile-time instead of infinite-looping. * Rationalize class<>::def() in preparation for docstring support * Partial docstring support in module::def (untested) * dependent<> trick moved to detail namespace and separate header * Added __doc__ attribute to C++ function wrapper objects * Sunk implementation of function_object into a library source file. [SVN r14724]
This commit is contained in:
@@ -28,21 +28,16 @@ module_base::~module_base()
|
||||
{
|
||||
}
|
||||
|
||||
void module_base::setattr(const char* name, PyObject* x)
|
||||
{
|
||||
setattr(name, handle<>(x));
|
||||
}
|
||||
|
||||
void module_base::setattr(char const* name, handle<> const& x)
|
||||
void module_base::setattr_doc(const char* name, python::object const& x, char const* doc)
|
||||
{
|
||||
// Use function::add_to_namespace to achieve overloading if
|
||||
// appropriate.
|
||||
objects::function::add_to_namespace(python::object(m_module), name, python::object(x));
|
||||
objects::function::add_to_namespace(python::object(m_module), name, x, doc);
|
||||
}
|
||||
|
||||
void module_base::add(type_handle const& x)
|
||||
{
|
||||
this->setattr(x->tp_name, x);
|
||||
this->setattr_doc(x->tp_name, python::object(x), 0);
|
||||
}
|
||||
|
||||
void module_base::add_class(type_handle const& class_obj)
|
||||
|
||||
Reference in New Issue
Block a user