2
0
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:
Ralf W. Grosse-Kunstleve
2002-06-03 18:35:59 +00:00
parent 16c391c78c
commit 7a832f1fdb
3 changed files with 15 additions and 2 deletions

View File

@@ -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];

View File

@@ -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;
}