diff --git a/include/boost/python/class.hpp b/include/boost/python/class.hpp index ae1705f6..16f6a4cf 100644 --- a/include/boost/python/class.hpp +++ b/include/boost/python/class.hpp @@ -168,17 +168,14 @@ class class_ : public objects::class_base { ref fget(make_getter(pm)); ref fset(make_setter(pm)); - this->add_property(name, fget, fset); - return *this; + return this->add_property(name, fget, fset); } // Property creation self& add_property(char const* name, ref const& fget); self& add_property(char const* name, ref const& fget, ref const& fset); - - // return the underlying object -// ref object() const; (implemented in base class) + self& setattr(char const* name, ref const&); private: // types typedef objects::class_id class_id; @@ -256,6 +253,13 @@ inline class_& class_::add_property(char const* name, re return *this; } +template +inline class_& class_::setattr(char const* name, ref const& x) +{ + class_base::setattr(name, x); + return *this; +} + namespace detail { // This is an mpl BinaryMetaFunction object with a runtime behavior,