01: package org.python.core;
02:
03: public class PyStaticMethod extends PyObject implements PyType.Newstyle {
04:
05: //~ BEGIN GENERATED REGION -- DO NOT EDIT SEE gexpose.py
06: /* type info */
07: public final static String exposed_name = "staticmethod";
08:
09: public static void typeSetup(PyObject dict, PyType.Newstyle marker) {
10: // xxx __get__
11: // xxx __init__
12:
13: dict.__setitem__("__new__", new PyNewWrapper(
14: PyStaticMethod.class, "__new__", 1, 1) {
15: public PyObject new_impl(boolean init, PyType subtype,
16: PyObject[] args, String[] keywords) {
17: if (keywords.length != 0 || args.length != 1) {
18: throw info.unexpectedCall(args.length,
19: keywords.length != 0);
20: }
21: return new PyStaticMethod(args[0]);
22: } // xxx subclassing
23: });
24: }
25:
26: //~ END GENERATED REGION -- DO NOT EDIT SEE gexpose.py
27:
28: protected PyObject callable;
29:
30: public PyStaticMethod(PyObject callable) {
31: this .callable = callable;
32: }
33:
34: /*
35: * @see org.python.core.PyObject#__get__(org.python.core.PyObject, org.python.core.PyObject)
36: */
37: public PyObject __get__(PyObject obj, PyObject type) {
38: return callable;
39: }
40:
41: }
|