01: package org.python.core;
02:
03: import java.io.Serializable;
04:
05: public class PyNotImplemented extends PySingleton implements
06: Serializable {
07: PyNotImplemented() {
08: super ("NotImplemented");
09: }
10:
11: public boolean __nonzero__() {
12: return false;
13: }
14:
15: public Object __tojava__(Class c) {
16: //Danger here. java.lang.Object gets null not None
17: if (c == PyObject.class)
18: return this ;
19: if (c.isPrimitive())
20: return Py.NoConversion;
21: return null;
22: }
23:
24: public String safeRepr() throws PyIgnoreMethodTag {
25: return "NotImplemented";
26: }
27:
28: public boolean isMappingType() {
29: return false;
30: }
31:
32: public boolean isSequenceType() {
33: return false;
34: }
35:
36: private Object writeReplace() {
37: return new Py.SingletonResolver("NotImplemented");
38: }
39:
40: }
|