<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Thank you David,
<p>But isn't this going to mess up the overloading?
<br>I also don't know how to create overloaded staticmethods in python.
<p>Nikolay
<p>David Abrahams wrote:
<blockquote TYPE=CITE>This is not the strategy I would've taken.
I think you should do
<br>something which mirrors pure Python:
<p>def foo(object):
<br> def f(x,y):
<br> return x*y
<br> f = staticmethod(f)
<p>So in C++, it would be something like:
<p> class_<foo>("foo")
<br> .def("f", &foo::f)
<br> .staticmethod("f")
// **
<br> ;
<p>Where the marked line would be implemented something like this:
<p> self& staticmethod(char const* name)
<br> {
<br> this->attr(name) = object(handle<>(
<br>
PyStaticMethod_New(this->attr(name).ptr())
<br>
));
<br> }
<p>--
<br>
David Abrahams
<br> dave@boost-consulting.com * <a href="http://www.boost-consulting.com">http://www.boost-consulting.com</a>
<br>Boost support, enhancements, training, and commercial distribution</blockquote>
</html>