@@ -212,7 +212,7 @@ <h4><a name="class_-spec-synopsis"></a>Class template <code>class_</code>
212212namespace boost { namespace python
213213{
214214 template <class T
215- < font color ="#007F00 "> , class Bases = bases<>
215+ < font color ="#007F00 "> , class Bases = bases<>
216216 , class HeldType = T
217217 , class NonCopyable = < i > unspecified</ i >
218218 >
@@ -242,6 +242,9 @@ <h4><a name="class_-spec-synopsis"></a>Class template <code>class_</code>
242242 template <class Fn, class A1, class A2, class A3>
243243 class_& def(char const* name, Fn fn, A1 const&, A2 const&, A3 const&);
244244
245+ // declaring method as static
246+ class_& staticmethod(char const* name);
247+
245248 // exposing operators
246249 template << i > unspecified</ i > >
247250 class_& def(< a href =
@@ -344,10 +347,11 @@ <h4><a name="class_-spec-modifiers"></a>Class template
344347 generated constructs an object of < code > HeldType</ code > according to
345348 the semantics described < a href ="#HeldType "> above</ a > , using a copy of
346349 < code > init_expr</ code > 's < a href ="CallPolicies.html "> call policies</ a > .
347- If the longest < a href ="init.html#init-expressions "> valid prefix</ a > of < code > Init</ code > contains < em > N</ em >
348- types and < code > init_expr</ code > holds < em > M</ em > keywords, an initial
349- sequence of the keywords are used for all but the first
350- < em > N</ em > - < em > M</ em > arguments of each overload.</ dt >
350+ If the longest < a href ="init.html#init-expressions "> valid prefix</ a > of
351+ < code > Init</ code > contains < em > N</ em > types and < code > init_expr</ code >
352+ holds < em > M</ em > keywords, an initial sequence of the keywords are used
353+ for all but the first < em > N</ em > - < em > M</ em > arguments of
354+ each overload.</ dt >
351355
352356 < dt > < b > Returns:</ b > < code > *this</ code > </ dt >
353357
@@ -378,20 +382,20 @@ <h4><a name="class_-spec-modifiers"></a>Class template
378382 < li >
379383 If < code > a1</ code > is the result of an < a href =
380384 "overloads.html#overload-dispatch-expression "> < em > overload-dispatch-expression</ em > </ a > ,
381- only the second form is allowed and fn must be a pointer
382- to function or pointer to member function whose < a
383- href ="definitions.html#arity "> arity</ a > is the same as A1's < a href =
384- "overloads.html#overload-dispatch-expression "> < em > maximum arity</ em > </ a > .
385+ only the second form is allowed and fn must be a pointer to
386+ function or pointer to member function whose < a href =
387+ "definitions.html#arity "> arity</ a > is the same as A1's < a href =
388+ "overloads.html#overload-dispatch-expression "> < em > maximum
389+ arity</ em > </ a > .
385390
386391 < dl >
387392 < dt > < b > Effects:</ b > For each prefix < em > P</ em > of
388- < code > Fn</ code > 's sequence of argument types, beginning
389- with the one whose length is < code > A1</ code > 's < a href =
390- "overloads.html#overload-dispatch-expression "> < em > minimum
391- arity</ em > </ a > , adds a
392- < code > < em > name</ em > (</ code > ...< code > )</ code > method
393- overload to the extension class. Each overload generated
394- invokes
393+ < code > Fn</ code > 's sequence of argument types, beginning with
394+ the one whose length is < code > A1</ code > 's < a href =
395+ "overloads.html#overload-dispatch-expression "> < em > minimum
396+ arity</ em > </ a > , adds a
397+ < code > < em > name</ em > (</ code > ...< code > )</ code > method overload to
398+ the extension class. Each overload generated invokes
395399 < code > a1</ code > 's call-expression with < em > P</ em > , using a copy
396400 of < code > a1</ code > 's < a href ="CallPolicies.html "> call
397401 policies</ a > . If the longest valid prefix of < code > A1</ code >
@@ -477,6 +481,37 @@ <h4><a name="class_-spec-modifiers"></a>Class template
477481 < dt > < b > Returns:</ b > < code > *this</ code > </ dt >
478482 </ dl >
479483< pre >
484+ class_& staticmethod(char const* name);
485+ </ pre >
486+
487+ < dl class ="function-semantics ">
488+ < dt > < b > Requires:</ b > < code > name</ code > is an < a href =
489+ "definitions.html#ntbs "> ntbs</ a > which conforms to Python's < a href =
490+ "http://www.python.org/doc/current/ref/identifiers.html "> identifier
491+ naming rules</ a > , and corresponds to a method whose overloads have all
492+ been defined.</ dt >
493+
494+ < dt > < b > Effects:</ b > Replaces the existing named attribute < i > x</ i > with
495+ the result of invoking < code > staticmethod(</ code > < i > x</ i > < code > )</ code >
496+ in Python. Specifies that the corresponding method is static and
497+ therefore no object instance will be passed to it. This is equivalent
498+ to the Python statement:</ dt >
499+
500+ < dd >
501+ < pre >
502+ setattr(self, name, staticmethod(getattr(self, name)))
503+ </ pre >
504+ </ dd >
505+
506+ < dt > < b > Note:</ b > Attempting to invoke < code > def(name,...)</ code > after
507+ invoking < code > staticmethod(name)</ code > will < a href =
508+ "definitions.html#raise "> raise</ a > a RuntimeError.</ dt >
509+
510+ < dt > < b > Returns:</ b > < code > *this</ code > </ dt >
511+ </ dl >
512+ < br >
513+
514+ < pre >
480515template << i > unspecified</ i > >
481516class_& def(< a href =
482517"operators.html#operator_-spec "> detail::operator_</ a > <unspecified>);
@@ -597,27 +632,21 @@ <h4><a name="class_-spec-modifiers"></a>Class template
597632</ pre >
598633
599634 < dl class ="function-semantics ">
600- < dt > < b > Requires:</ b > PickleSuite must be publically derived from
601- < a href ="pickle.html "
602- > < code > pickle_suite</ code > </ a > .</ dt >
635+ < dt > < b > Requires:</ b > PickleSuite must be publically derived from < a
636+ href ="pickle.html "> < code > pickle_suite</ code > </ a > .</ dt >
603637
604638 < dt > < b > Effects:</ b > Defines a legal combination of the special
605- attributes and methods:
606- < code > __getinitargs__</ code > ,
607- < code > __getstate__</ code > ,
608- < code > __setstate__</ code > ,
609- < code > __getstate_manages_dict__</ code > ,
610- < code > __safe_for_unpickling__</ code > ,
611- < code > __reduce__</ code >
612- </ dt >
639+ attributes and methods: < code > __getinitargs__</ code > ,
640+ < code > __getstate__</ code > , < code > __setstate__</ code > ,
641+ < code > __getstate_manages_dict__</ code > ,
642+ < code > __safe_for_unpickling__</ code > , < code > __reduce__</ code > </ dt >
613643
614644 < dt > < b > Returns:</ b > < code > *this</ code > </ dt >
615645
616- < dt > < b > Rationale:</ b > Provides an
617- < a href ="pickle.html "
618- > easy to use high-level interface</ a >
619- for establishing complete pickle support for the wrapped class.
620- The user is protected by compile-time consistency checks.</ dt >
646+ < dt > < b > Rationale:</ b > Provides an < a href ="pickle.html "> easy to use
647+ high-level interface</ a > for establishing complete pickle support for
648+ the wrapped class. The user is protected by compile-time consistency
649+ checks.</ dt >
621650 </ dl >
622651 < br >
623652
@@ -685,8 +714,8 @@ <h2><a name="examples"></a>Example(s)</h2>
685714</ pre >
686715 Revised
687716 <!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->
688- 13 November, 2002
689- <!--webbot bot="Timestamp" endspan i-checksum="39359" -->
717+ 13 November, 2002
718+ <!--webbot bot="Timestamp" endspan i-checksum="39359" -->
690719
691720
692721 < p > < i > © Copyright < a href =
0 commit comments