1 package org.python.core; 3 4 7 public class PyNone extends PySingleton 8 { 9 PyNone() { 10 super("None"); 11 } 12 13 public boolean __nonzero__() { 14 return false; 15 } 16 17 public Object __tojava__(Class c) { 18 if (c == PyObject.class) 20 return this; 21 if (c.isPrimitive()) 22 return Py.NoConversion; 23 return null; 24 } 25 26 public String safeRepr() throws PyIgnoreMethodTag { 27 return "'None' object"; 28 } 29 30 public boolean isMappingType() { return false; } 31 public boolean isSequenceType() { return false; } 32 public boolean isNumberType() { return false; } 33 public String asStringOrNull(int index) { return null; } 34 } 35 | Popular Tags |