mirror of
https://github.com/boostorg/python.git
synced 2026-01-27 07:02:15 +00:00
automatic addition of __module__ to class dict
[SVN r14072]
This commit is contained in:
@@ -26,6 +26,9 @@ class BOOST_PYTHON_DECL module_base
|
||||
// Return a reference to the Python module object being built
|
||||
inline ref object() const;
|
||||
|
||||
protected:
|
||||
void generic_add_class(ref class_obj);
|
||||
|
||||
private:
|
||||
ref m_module;
|
||||
static PyMethodDef initial_methods[1];
|
||||
|
||||
@@ -31,8 +31,7 @@ class module : public detail::module_base
|
||||
template <class T, class Bases, class HolderGenerator>
|
||||
module& add(class_<T,Bases,HolderGenerator> const& c)
|
||||
{
|
||||
Py_INCREF(c.object());
|
||||
this->add_type(c.object());
|
||||
this->generic_add_class(c.object());
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user