diff --git a/doc/v2/class.html b/doc/v2/class.html index f7bc46db..1c84c1c2 100644 --- a/doc/v2/class.html +++ b/doc/v2/class.html @@ -223,7 +223,7 @@ namespace boost { namespace python class_& def_init(Args const& = Args()); template <class Args, class CallPolicy> - self& def_init(Args const&, CallPolicy policy); + class_& def_init(Args const&, CallPolicy policy); // exposing member functions template <class F> @@ -234,10 +234,13 @@ namespace boost { namespace python // exposing data members template <class D> - self& def_readonly(char const* name, D T::*pm); + class_& def_readonly(char const* name, D T::*pm); template <class D> - self& def_readwrite(char const* name, D T::*pm); + class_& def_readwrite(char const* name, D T::*pm); + + // Raw attribute modification + class_& setattr(char const* name, ref const&); // property creation void add_property(char const* name, ref const& fget); @@ -339,9 +342,11 @@ class_& def(char const* name, Fn f, CallPolicies policies);
f is a non-null pointer-to-function or
- pointer-to-member-function. name is a ntbs which conforms to
- Python's Requires: f is a non-null
+ pointer-to-function or pointer-to-member-function, or a callable
+ Python object passed as a PyObject* or ref. name
+ is a ntbs which conforms to Python's identifier
naming rules. In the first form, the return type of
f is not a reference and is not a pointer other
@@ -350,7 +355,8 @@ class_& def(char const* name, Fn f, CallPolicies policies);
href="CallPolicies.html">CallPolicies.
make_function(f) to
+ "make_function.html#make_function-spec">make_function(f) or make_function(f, policies) to
the Boost.Python extension class being defined, with the given
name. If the extension class already has an attribute named
name, the usual Returns: *this
+template <class F> +class_& setattr(char const* name, ref x); ++ +
name is a ntbs which conforms to
+ Python's identifier
+ naming rules.
+
+ PyObject_SetAttrString(this->object(), name, x.get());
+
+ *this
+ -void add_property(char const* name, ref const& fget); -void add_property(char const* name, ref const& fget, ref const& fset); +void add_property(char const* name, ref const& fget); +void add_property(char const* name, ref const& fget, ref const& fset);
template <class D>
- self& def_readonly(char const* name, D T::*pm);
+ class_& def_readonly(char const* name, D T::*pm);
template <class D> -self& def_readwrite(char const* name, D T::*pm); +class_& def_readwrite(char const* name, D T::*pm);