From: <pj...@us...> - 2008-10-12 22:38:07
|
Revision: 5382 http://jython.svn.sourceforge.net/jython/?rev=5382&view=rev Author: pjenvey Date: 2008-10-12 22:37:53 +0000 (Sun, 12 Oct 2008) Log Message: ----------- update the deriveds for better unhashable TypeError messages Modified Paths: -------------- trunk/jython/src/org/python/core/PyArrayDerived.java trunk/jython/src/org/python/core/PyBaseExceptionDerived.java trunk/jython/src/org/python/core/PyBooleanDerived.java trunk/jython/src/org/python/core/PyClassMethodDerived.java trunk/jython/src/org/python/core/PyComplexDerived.java trunk/jython/src/org/python/core/PyDictionaryDerived.java trunk/jython/src/org/python/core/PyEnumerateDerived.java trunk/jython/src/org/python/core/PyFileDerived.java trunk/jython/src/org/python/core/PyFloatDerived.java trunk/jython/src/org/python/core/PyFrozenSetDerived.java trunk/jython/src/org/python/core/PyIntegerDerived.java trunk/jython/src/org/python/core/PyListDerived.java trunk/jython/src/org/python/core/PyLongDerived.java trunk/jython/src/org/python/core/PyModuleDerived.java trunk/jython/src/org/python/core/PyObjectDerived.java trunk/jython/src/org/python/core/PyPropertyDerived.java trunk/jython/src/org/python/core/PySetDerived.java trunk/jython/src/org/python/core/PySliceDerived.java trunk/jython/src/org/python/core/PyStringDerived.java trunk/jython/src/org/python/core/PySuperDerived.java trunk/jython/src/org/python/core/PyTupleDerived.java trunk/jython/src/org/python/core/PyTypeDerived.java trunk/jython/src/org/python/core/PyUnicodeDerived.java trunk/jython/src/org/python/modules/_collections/PyDefaultDictDerived.java trunk/jython/src/org/python/modules/_collections/PyDequeDerived.java trunk/jython/src/org/python/modules/_csv/PyDialectDerived.java trunk/jython/src/org/python/modules/_functools/PyPartialDerived.java trunk/jython/src/org/python/modules/_weakref/ReferenceTypeDerived.java trunk/jython/src/org/python/modules/random/PyRandomDerived.java trunk/jython/src/org/python/modules/thread/PyLocalDerived.java trunk/jython/src/org/python/modules/zipimport/zipimporterDerived.java Modified: trunk/jython/src/org/python/core/PyArrayDerived.java =================================================================== --- trunk/jython/src/org/python/core/PyArrayDerived.java 2008-10-12 22:18:06 UTC (rev 5381) +++ trunk/jython/src/org/python/core/PyArrayDerived.java 2008-10-12 22:37:53 UTC (rev 5382) @@ -744,7 +744,7 @@ throw Py.TypeError("__hash__ should return a int"); } if (self_type.lookup("__eq__")!=null||self_type.lookup("__cmp__")!=null) { - throw Py.TypeError("unhashable type"); + throw Py.TypeError(String.format("unhashable type: '%.200s'",getType().fastGetName())); } return super.hashCode(); } Modified: trunk/jython/src/org/python/core/PyBaseExceptionDerived.java =================================================================== --- trunk/jython/src/org/python/core/PyBaseExceptionDerived.java 2008-10-12 22:18:06 UTC (rev 5381) +++ trunk/jython/src/org/python/core/PyBaseExceptionDerived.java 2008-10-12 22:37:53 UTC (rev 5382) @@ -720,7 +720,7 @@ throw Py.TypeError("__hash__ should return a int"); } if (self_type.lookup("__eq__")!=null||self_type.lookup("__cmp__")!=null) { - throw Py.TypeError("unhashable type"); + throw Py.TypeError(String.format("unhashable type: '%.200s'",getType().fastGetName())); } return super.hashCode(); } Modified: trunk/jython/src/org/python/core/PyBooleanDerived.java =================================================================== --- trunk/jython/src/org/python/core/PyBooleanDerived.java 2008-10-12 22:18:06 UTC (rev 5381) +++ trunk/jython/src/org/python/core/PyBooleanDerived.java 2008-10-12 22:37:53 UTC (rev 5382) @@ -744,7 +744,7 @@ throw Py.TypeError("__hash__ should return a int"); } if (self_type.lookup("__eq__")!=null||self_type.lookup("__cmp__")!=null) { - throw Py.TypeError("unhashable type"); + throw Py.TypeError(String.format("unhashable type: '%.200s'",getType().fastGetName())); } return super.hashCode(); } Modified: trunk/jython/src/org/python/core/PyClassMethodDerived.java =================================================================== --- trunk/jython/src/org/python/core/PyClassMethodDerived.java 2008-10-12 22:18:06 UTC (rev 5381) +++ trunk/jython/src/org/python/core/PyClassMethodDerived.java 2008-10-12 22:37:53 UTC (rev 5382) @@ -744,7 +744,7 @@ throw Py.TypeError("__hash__ should return a int"); } if (self_type.lookup("__eq__")!=null||self_type.lookup("__cmp__")!=null) { - throw Py.TypeError("unhashable type"); + throw Py.TypeError(String.format("unhashable type: '%.200s'",getType().fastGetName())); } return super.hashCode(); } Modified: trunk/jython/src/org/python/core/PyComplexDerived.java =================================================================== --- trunk/jython/src/org/python/core/PyComplexDerived.java 2008-10-12 22:18:06 UTC (rev 5381) +++ trunk/jython/src/org/python/core/PyComplexDerived.java 2008-10-12 22:37:53 UTC (rev 5382) @@ -744,7 +744,7 @@ throw Py.TypeError("__hash__ should return a int"); } if (self_type.lookup("__eq__")!=null||self_type.lookup("__cmp__")!=null) { - throw Py.TypeError("unhashable type"); + throw Py.TypeError(String.format("unhashable type: '%.200s'",getType().fastGetName())); } return super.hashCode(); } Modified: trunk/jython/src/org/python/core/PyDictionaryDerived.java =================================================================== --- trunk/jython/src/org/python/core/PyDictionaryDerived.java 2008-10-12 22:18:06 UTC (rev 5381) +++ trunk/jython/src/org/python/core/PyDictionaryDerived.java 2008-10-12 22:37:53 UTC (rev 5382) @@ -744,7 +744,7 @@ throw Py.TypeError("__hash__ should return a int"); } if (self_type.lookup("__eq__")!=null||self_type.lookup("__cmp__")!=null) { - throw Py.TypeError("unhashable type"); + throw Py.TypeError(String.format("unhashable type: '%.200s'",getType().fastGetName())); } return super.hashCode(); } Modified: trunk/jython/src/org/python/core/PyEnumerateDerived.java =================================================================== --- trunk/jython/src/org/python/core/PyEnumerateDerived.java 2008-10-12 22:18:06 UTC (rev 5381) +++ trunk/jython/src/org/python/core/PyEnumerateDerived.java 2008-10-12 22:37:53 UTC (rev 5382) @@ -744,7 +744,7 @@ throw Py.TypeError("__hash__ should return a int"); } if (self_type.lookup("__eq__")!=null||self_type.lookup("__cmp__")!=null) { - throw Py.TypeError("unhashable type"); + throw Py.TypeError(String.format("unhashable type: '%.200s'",getType().fastGetName())); } return super.hashCode(); } Modified: trunk/jython/src/org/python/core/PyFileDerived.java =================================================================== --- trunk/jython/src/org/python/core/PyFileDerived.java 2008-10-12 22:18:06 UTC (rev 5381) +++ trunk/jython/src/org/python/core/PyFileDerived.java 2008-10-12 22:37:53 UTC (rev 5382) @@ -744,7 +744,7 @@ throw Py.TypeError("__hash__ should return a int"); } if (self_type.lookup("__eq__")!=null||self_type.lookup("__cmp__")!=null) { - throw Py.TypeError("unhashable type"); + throw Py.TypeError(String.format("unhashable type: '%.200s'",getType().fastGetName())); } return super.hashCode(); } Modified: trunk/jython/src/org/python/core/PyFloatDerived.java =================================================================== --- trunk/jython/src/org/python/core/PyFloatDerived.java 2008-10-12 22:18:06 UTC (rev 5381) +++ trunk/jython/src/org/python/core/PyFloatDerived.java 2008-10-12 22:37:53 UTC (rev 5382) @@ -744,7 +744,7 @@ throw Py.TypeError("__hash__ should return a int"); } if (self_type.lookup("__eq__")!=null||self_type.lookup("__cmp__")!=null) { - throw Py.TypeError("unhashable type"); + throw Py.TypeError(String.format("unhashable type: '%.200s'",getType().fastGetName())); } return super.hashCode(); } Modified: trunk/jython/src/org/python/core/PyFrozenSetDerived.java =================================================================== --- trunk/jython/src/org/python/core/PyFrozenSetDerived.java 2008-10-12 22:18:06 UTC (rev 5381) +++ trunk/jython/src/org/python/core/PyFrozenSetDerived.java 2008-10-12 22:37:53 UTC (rev 5382) @@ -744,7 +744,7 @@ throw Py.TypeError("__hash__ should return a int"); } if (self_type.lookup("__eq__")!=null||self_type.lookup("__cmp__")!=null) { - throw Py.TypeError("unhashable type"); + throw Py.TypeError(String.format("unhashable type: '%.200s'",getType().fastGetName())); } return super.hashCode(); } Modified: trunk/jython/src/org/python/core/PyIntegerDerived.java =================================================================== --- trunk/jython/src/org/python/core/PyIntegerDerived.java 2008-10-12 22:18:06 UTC (rev 5381) +++ trunk/jython/src/org/python/core/PyIntegerDerived.java 2008-10-12 22:37:53 UTC (rev 5382) @@ -744,7 +744,7 @@ throw Py.TypeError("__hash__ should return a int"); } if (self_type.lookup("__eq__")!=null||self_type.lookup("__cmp__")!=null) { - throw Py.TypeError("unhashable type"); + throw Py.TypeError(String.format("unhashable type: '%.200s'",getType().fastGetName())); } return super.hashCode(); } Modified: trunk/jython/src/org/python/core/PyListDerived.java =================================================================== --- trunk/jython/src/org/python/core/PyListDerived.java 2008-10-12 22:18:06 UTC (rev 5381) +++ trunk/jython/src/org/python/core/PyListDerived.java 2008-10-12 22:37:53 UTC (rev 5382) @@ -744,7 +744,7 @@ throw Py.TypeError("__hash__ should return a int"); } if (self_type.lookup("__eq__")!=null||self_type.lookup("__cmp__")!=null) { - throw Py.TypeError("unhashable type"); + throw Py.TypeError(String.format("unhashable type: '%.200s'",getType().fastGetName())); } return super.hashCode(); } Modified: trunk/jython/src/org/python/core/PyLongDerived.java =================================================================== --- trunk/jython/src/org/python/core/PyLongDerived.java 2008-10-12 22:18:06 UTC (rev 5381) +++ trunk/jython/src/org/python/core/PyLongDerived.java 2008-10-12 22:37:53 UTC (rev 5382) @@ -744,7 +744,7 @@ throw Py.TypeError("__hash__ should return a int"); } if (self_type.lookup("__eq__")!=null||self_type.lookup("__cmp__")!=null) { - throw Py.TypeError("unhashable type"); + throw Py.TypeError(String.format("unhashable type: '%.200s'",getType().fastGetName())); } return super.hashCode(); } Modified: trunk/jython/src/org/python/core/PyModuleDerived.java =================================================================== --- trunk/jython/src/org/python/core/PyModuleDerived.java 2008-10-12 22:18:06 UTC (rev 5381) +++ trunk/jython/src/org/python/core/PyModuleDerived.java 2008-10-12 22:37:53 UTC (rev 5382) @@ -720,7 +720,7 @@ throw Py.TypeError("__hash__ should return a int"); } if (self_type.lookup("__eq__")!=null||self_type.lookup("__cmp__")!=null) { - throw Py.TypeError("unhashable type"); + throw Py.TypeError(String.format("unhashable type: '%.200s'",getType().fastGetName())); } return super.hashCode(); } Modified: trunk/jython/src/org/python/core/PyObjectDerived.java =================================================================== --- trunk/jython/src/org/python/core/PyObjectDerived.java 2008-10-12 22:18:06 UTC (rev 5381) +++ trunk/jython/src/org/python/core/PyObjectDerived.java 2008-10-12 22:37:53 UTC (rev 5382) @@ -744,7 +744,7 @@ throw Py.TypeError("__hash__ should return a int"); } if (self_type.lookup("__eq__")!=null||self_type.lookup("__cmp__")!=null) { - throw Py.TypeError("unhashable type"); + throw Py.TypeError(String.format("unhashable type: '%.200s'",getType().fastGetName())); } return super.hashCode(); } Modified: trunk/jython/src/org/python/core/PyPropertyDerived.java =================================================================== --- trunk/jython/src/org/python/core/PyPropertyDerived.java 2008-10-12 22:18:06 UTC (rev 5381) +++ trunk/jython/src/org/python/core/PyPropertyDerived.java 2008-10-12 22:37:53 UTC (rev 5382) @@ -744,7 +744,7 @@ throw Py.TypeError("__hash__ should return a int"); } if (self_type.lookup("__eq__")!=null||self_type.lookup("__cmp__")!=null) { - throw Py.TypeError("unhashable type"); + throw Py.TypeError(String.format("unhashable type: '%.200s'",getType().fastGetName())); } return super.hashCode(); } Modified: trunk/jython/src/org/python/core/PySetDerived.java =================================================================== --- trunk/jython/src/org/python/core/PySetDerived.java 2008-10-12 22:18:06 UTC (rev 5381) +++ trunk/jython/src/org/python/core/PySetDerived.java 2008-10-12 22:37:53 UTC (rev 5382) @@ -744,7 +744,7 @@ throw Py.TypeError("__hash__ should return a int"); } if (self_type.lookup("__eq__")!=null||self_type.lookup("__cmp__")!=null) { - throw Py.TypeError("unhashable type"); + throw Py.TypeError(String.format("unhashable type: '%.200s'",getType().fastGetName())); } return super.hashCode(); } Modified: trunk/jython/src/org/python/core/PySliceDerived.java =================================================================== --- trunk/jython/src/org/python/core/PySliceDerived.java 2008-10-12 22:18:06 UTC (rev 5381) +++ trunk/jython/src/org/python/core/PySliceDerived.java 2008-10-12 22:37:53 UTC (rev 5382) @@ -744,7 +744,7 @@ throw Py.TypeError("__hash__ should return a int"); } if (self_type.lookup("__eq__")!=null||self_type.lookup("__cmp__")!=null) { - throw Py.TypeError("unhashable type"); + throw Py.TypeError(String.format("unhashable type: '%.200s'",getType().fastGetName())); } return super.hashCode(); } Modified: trunk/jython/src/org/python/core/PyStringDerived.java =================================================================== --- trunk/jython/src/org/python/core/PyStringDerived.java 2008-10-12 22:18:06 UTC (rev 5381) +++ trunk/jython/src/org/python/core/PyStringDerived.java 2008-10-12 22:37:53 UTC (rev 5382) @@ -744,7 +744,7 @@ throw Py.TypeError("__hash__ should return a int"); } if (self_type.lookup("__eq__")!=null||self_type.lookup("__cmp__")!=null) { - throw Py.TypeError("unhashable type"); + throw Py.TypeError(String.format("unhashable type: '%.200s'",getType().fastGetName())); } return super.hashCode(); } Modified: trunk/jython/src/org/python/core/PySuperDerived.java =================================================================== --- trunk/jython/src/org/python/core/PySuperDerived.java 2008-10-12 22:18:06 UTC (rev 5381) +++ trunk/jython/src/org/python/core/PySuperDerived.java 2008-10-12 22:37:53 UTC (rev 5382) @@ -744,7 +744,7 @@ throw Py.TypeError("__hash__ should return a int"); } if (self_type.lookup("__eq__")!=null||self_type.lookup("__cmp__")!=null) { - throw Py.TypeError("unhashable type"); + throw Py.TypeError(String.format("unhashable type: '%.200s'",getType().fastGetName())); } return super.hashCode(); } Modified: trunk/jython/src/org/python/core/PyTupleDerived.java =================================================================== --- trunk/jython/src/org/python/core/PyTupleDerived.java 2008-10-12 22:18:06 UTC (rev 5381) +++ trunk/jython/src/org/python/core/PyTupleDerived.java 2008-10-12 22:37:53 UTC (rev 5382) @@ -744,7 +744,7 @@ throw Py.TypeError("__hash__ should return a int"); } if (self_type.lookup("__eq__")!=null||self_type.lookup("__cmp__")!=null) { - throw Py.TypeError("unhashable type"); + throw Py.TypeError(String.format("unhashable type: '%.200s'",getType().fastGetName())); } return super.hashCode(); } Modified: trunk/jython/src/org/python/core/PyTypeDerived.java =================================================================== --- trunk/jython/src/org/python/core/PyTypeDerived.java 2008-10-12 22:18:06 UTC (rev 5381) +++ trunk/jython/src/org/python/core/PyTypeDerived.java 2008-10-12 22:37:53 UTC (rev 5382) @@ -720,7 +720,7 @@ throw Py.TypeError("__hash__ should return a int"); } if (self_type.lookup("__eq__")!=null||self_type.lookup("__cmp__")!=null) { - throw Py.TypeError("unhashable type"); + throw Py.TypeError(String.format("unhashable type: '%.200s'",getType().fastGetName())); } return super.hashCode(); } Modified: trunk/jython/src/org/python/core/PyUnicodeDerived.java =================================================================== --- trunk/jython/src/org/python/core/PyUnicodeDerived.java 2008-10-12 22:18:06 UTC (rev 5381) +++ trunk/jython/src/org/python/core/PyUnicodeDerived.java 2008-10-12 22:37:53 UTC (rev 5382) @@ -744,7 +744,7 @@ throw Py.TypeError("__hash__ should return a int"); } if (self_type.lookup("__eq__")!=null||self_type.lookup("__cmp__")!=null) { - throw Py.TypeError("unhashable type"); + throw Py.TypeError(String.format("unhashable type: '%.200s'",getType().fastGetName())); } return super.hashCode(); } Modified: trunk/jython/src/org/python/modules/_collections/PyDefaultDictDerived.java =================================================================== --- trunk/jython/src/org/python/modules/_collections/PyDefaultDictDerived.java 2008-10-12 22:18:06 UTC (rev 5381) +++ trunk/jython/src/org/python/modules/_collections/PyDefaultDictDerived.java 2008-10-12 22:37:53 UTC (rev 5382) @@ -746,7 +746,7 @@ throw Py.TypeError("__hash__ should return a int"); } if (self_type.lookup("__eq__")!=null||self_type.lookup("__cmp__")!=null) { - throw Py.TypeError("unhashable type"); + throw Py.TypeError(String.format("unhashable type: '%.200s'",getType().fastGetName())); } return super.hashCode(); } Modified: trunk/jython/src/org/python/modules/_collections/PyDequeDerived.java =================================================================== --- trunk/jython/src/org/python/modules/_collections/PyDequeDerived.java 2008-10-12 22:18:06 UTC (rev 5381) +++ trunk/jython/src/org/python/modules/_collections/PyDequeDerived.java 2008-10-12 22:37:53 UTC (rev 5382) @@ -746,7 +746,7 @@ throw Py.TypeError("__hash__ should return a int"); } if (self_type.lookup("__eq__")!=null||self_type.lookup("__cmp__")!=null) { - throw Py.TypeError("unhashable type"); + throw Py.TypeError(String.format("unhashable type: '%.200s'",getType().fastGetName())); } return super.hashCode(); } Modified: trunk/jython/src/org/python/modules/_csv/PyDialectDerived.java =================================================================== --- trunk/jython/src/org/python/modules/_csv/PyDialectDerived.java 2008-10-12 22:18:06 UTC (rev 5381) +++ trunk/jython/src/org/python/modules/_csv/PyDialectDerived.java 2008-10-12 22:37:53 UTC (rev 5382) @@ -722,7 +722,7 @@ throw Py.TypeError("__hash__ should return a int"); } if (self_type.lookup("__eq__")!=null||self_type.lookup("__cmp__")!=null) { - throw Py.TypeError("unhashable type"); + throw Py.TypeError(String.format("unhashable type: '%.200s'",getType().fastGetName())); } return super.hashCode(); } Modified: trunk/jython/src/org/python/modules/_functools/PyPartialDerived.java =================================================================== --- trunk/jython/src/org/python/modules/_functools/PyPartialDerived.java 2008-10-12 22:18:06 UTC (rev 5381) +++ trunk/jython/src/org/python/modules/_functools/PyPartialDerived.java 2008-10-12 22:37:53 UTC (rev 5382) @@ -722,7 +722,7 @@ throw Py.TypeError("__hash__ should return a int"); } if (self_type.lookup("__eq__")!=null||self_type.lookup("__cmp__")!=null) { - throw Py.TypeError("unhashable type"); + throw Py.TypeError(String.format("unhashable type: '%.200s'",getType().fastGetName())); } return super.hashCode(); } Modified: trunk/jython/src/org/python/modules/_weakref/ReferenceTypeDerived.java =================================================================== --- trunk/jython/src/org/python/modules/_weakref/ReferenceTypeDerived.java 2008-10-12 22:18:06 UTC (rev 5381) +++ trunk/jython/src/org/python/modules/_weakref/ReferenceTypeDerived.java 2008-10-12 22:37:53 UTC (rev 5382) @@ -746,7 +746,7 @@ throw Py.TypeError("__hash__ should return a int"); } if (self_type.lookup("__eq__")!=null||self_type.lookup("__cmp__")!=null) { - throw Py.TypeError("unhashable type"); + throw Py.TypeError(String.format("unhashable type: '%.200s'",getType().fastGetName())); } return super.hashCode(); } Modified: trunk/jython/src/org/python/modules/random/PyRandomDerived.java =================================================================== --- trunk/jython/src/org/python/modules/random/PyRandomDerived.java 2008-10-12 22:18:06 UTC (rev 5381) +++ trunk/jython/src/org/python/modules/random/PyRandomDerived.java 2008-10-12 22:37:53 UTC (rev 5382) @@ -746,7 +746,7 @@ throw Py.TypeError("__hash__ should return a int"); } if (self_type.lookup("__eq__")!=null||self_type.lookup("__cmp__")!=null) { - throw Py.TypeError("unhashable type"); + throw Py.TypeError(String.format("unhashable type: '%.200s'",getType().fastGetName())); } return super.hashCode(); } Modified: trunk/jython/src/org/python/modules/thread/PyLocalDerived.java =================================================================== --- trunk/jython/src/org/python/modules/thread/PyLocalDerived.java 2008-10-12 22:18:06 UTC (rev 5381) +++ trunk/jython/src/org/python/modules/thread/PyLocalDerived.java 2008-10-12 22:37:53 UTC (rev 5382) @@ -722,7 +722,7 @@ throw Py.TypeError("__hash__ should return a int"); } if (self_type.lookup("__eq__")!=null||self_type.lookup("__cmp__")!=null) { - throw Py.TypeError("unhashable type"); + throw Py.TypeError(String.format("unhashable type: '%.200s'",getType().fastGetName())); } return super.hashCode(); } Modified: trunk/jython/src/org/python/modules/zipimport/zipimporterDerived.java =================================================================== --- trunk/jython/src/org/python/modules/zipimport/zipimporterDerived.java 2008-10-12 22:18:06 UTC (rev 5381) +++ trunk/jython/src/org/python/modules/zipimport/zipimporterDerived.java 2008-10-12 22:37:53 UTC (rev 5382) @@ -722,7 +722,7 @@ throw Py.TypeError("__hash__ should return a int"); } if (self_type.lookup("__eq__")!=null||self_type.lookup("__cmp__")!=null) { - throw Py.TypeError("unhashable type"); + throw Py.TypeError(String.format("unhashable type: '%.200s'",getType().fastGetName())); } return super.hashCode(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |