From: <pj...@us...> - 2008-06-20 08:29:26
|
Revision: 4700 http://jython.svn.sourceforge.net/jython/?rev=4700&view=rev Author: pjenvey Date: 2008-06-20 01:29:23 -0700 (Fri, 20 Jun 2008) Log Message: ----------- allow deriveds __long__ to return a PyInteger Modified Paths: -------------- trunk/jython/src/org/python/core/PyArrayDerived.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/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/_weakref/ReferenceTypeDerived.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/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-06-20 08:28:26 UTC (rev 4699) +++ trunk/jython/src/org/python/core/PyArrayDerived.java 2008-06-20 08:29:23 UTC (rev 4700) @@ -102,18 +102,6 @@ return super.__float__(); } - public PyLong __long__() { - PyType self_type=getType(); - PyObject impl=self_type.lookup("__long__"); - if (impl!=null) { - PyObject res=impl.__get__(this,self_type).__call__(); - if (res instanceof PyLong) - return(PyLong)res; - throw Py.TypeError("__long__"+" returned non-"+"long"+" (type "+res.getType().fastGetName()+")"); - } - return super.__long__(); - } - public PyComplex __complex__() { PyType self_type=getType(); PyObject impl=self_type.lookup("__complex__"); @@ -678,6 +666,18 @@ return super.__int__(); } + public PyObject __long__() { + PyType self_type=getType(); + PyObject impl=self_type.lookup("__long__"); + if (impl!=null) { + PyObject res=impl.__get__(this,self_type).__call__(); + if (res instanceof PyLong||res instanceof PyInteger) + return res; + throw Py.TypeError("__long__"+" returned non-"+"long"+" (type "+res.getType().fastGetName()+")"); + } + return super.__long__(); + } + public int hashCode() { PyType self_type=getType(); PyObject impl=self_type.lookup("__hash__"); Modified: trunk/jython/src/org/python/core/PyBooleanDerived.java =================================================================== --- trunk/jython/src/org/python/core/PyBooleanDerived.java 2008-06-20 08:28:26 UTC (rev 4699) +++ trunk/jython/src/org/python/core/PyBooleanDerived.java 2008-06-20 08:29:23 UTC (rev 4700) @@ -102,18 +102,6 @@ return super.__float__(); } - public PyLong __long__() { - PyType self_type=getType(); - PyObject impl=self_type.lookup("__long__"); - if (impl!=null) { - PyObject res=impl.__get__(this,self_type).__call__(); - if (res instanceof PyLong) - return(PyLong)res; - throw Py.TypeError("__long__"+" returned non-"+"long"+" (type "+res.getType().fastGetName()+")"); - } - return super.__long__(); - } - public PyComplex __complex__() { PyType self_type=getType(); PyObject impl=self_type.lookup("__complex__"); @@ -678,6 +666,18 @@ return super.__int__(); } + public PyObject __long__() { + PyType self_type=getType(); + PyObject impl=self_type.lookup("__long__"); + if (impl!=null) { + PyObject res=impl.__get__(this,self_type).__call__(); + if (res instanceof PyLong||res instanceof PyInteger) + return res; + throw Py.TypeError("__long__"+" returned non-"+"long"+" (type "+res.getType().fastGetName()+")"); + } + return super.__long__(); + } + public int hashCode() { PyType self_type=getType(); PyObject impl=self_type.lookup("__hash__"); Modified: trunk/jython/src/org/python/core/PyClassMethodDerived.java =================================================================== --- trunk/jython/src/org/python/core/PyClassMethodDerived.java 2008-06-20 08:28:26 UTC (rev 4699) +++ trunk/jython/src/org/python/core/PyClassMethodDerived.java 2008-06-20 08:29:23 UTC (rev 4700) @@ -102,18 +102,6 @@ return super.__float__(); } - public PyLong __long__() { - PyType self_type=getType(); - PyObject impl=self_type.lookup("__long__"); - if (impl!=null) { - PyObject res=impl.__get__(this,self_type).__call__(); - if (res instanceof PyLong) - return(PyLong)res; - throw Py.TypeError("__long__"+" returned non-"+"long"+" (type "+res.getType().fastGetName()+")"); - } - return super.__long__(); - } - public PyComplex __complex__() { PyType self_type=getType(); PyObject impl=self_type.lookup("__complex__"); @@ -678,6 +666,18 @@ return super.__int__(); } + public PyObject __long__() { + PyType self_type=getType(); + PyObject impl=self_type.lookup("__long__"); + if (impl!=null) { + PyObject res=impl.__get__(this,self_type).__call__(); + if (res instanceof PyLong||res instanceof PyInteger) + return res; + throw Py.TypeError("__long__"+" returned non-"+"long"+" (type "+res.getType().fastGetName()+")"); + } + return super.__long__(); + } + public int hashCode() { PyType self_type=getType(); PyObject impl=self_type.lookup("__hash__"); Modified: trunk/jython/src/org/python/core/PyComplexDerived.java =================================================================== --- trunk/jython/src/org/python/core/PyComplexDerived.java 2008-06-20 08:28:26 UTC (rev 4699) +++ trunk/jython/src/org/python/core/PyComplexDerived.java 2008-06-20 08:29:23 UTC (rev 4700) @@ -102,18 +102,6 @@ return super.__float__(); } - public PyLong __long__() { - PyType self_type=getType(); - PyObject impl=self_type.lookup("__long__"); - if (impl!=null) { - PyObject res=impl.__get__(this,self_type).__call__(); - if (res instanceof PyLong) - return(PyLong)res; - throw Py.TypeError("__long__"+" returned non-"+"long"+" (type "+res.getType().fastGetName()+")"); - } - return super.__long__(); - } - public PyComplex __complex__() { PyType self_type=getType(); PyObject impl=self_type.lookup("__complex__"); @@ -678,6 +666,18 @@ return super.__int__(); } + public PyObject __long__() { + PyType self_type=getType(); + PyObject impl=self_type.lookup("__long__"); + if (impl!=null) { + PyObject res=impl.__get__(this,self_type).__call__(); + if (res instanceof PyLong||res instanceof PyInteger) + return res; + throw Py.TypeError("__long__"+" returned non-"+"long"+" (type "+res.getType().fastGetName()+")"); + } + return super.__long__(); + } + public int hashCode() { PyType self_type=getType(); PyObject impl=self_type.lookup("__hash__"); Modified: trunk/jython/src/org/python/core/PyDictionaryDerived.java =================================================================== --- trunk/jython/src/org/python/core/PyDictionaryDerived.java 2008-06-20 08:28:26 UTC (rev 4699) +++ trunk/jython/src/org/python/core/PyDictionaryDerived.java 2008-06-20 08:29:23 UTC (rev 4700) @@ -102,18 +102,6 @@ return super.__float__(); } - public PyLong __long__() { - PyType self_type=getType(); - PyObject impl=self_type.lookup("__long__"); - if (impl!=null) { - PyObject res=impl.__get__(this,self_type).__call__(); - if (res instanceof PyLong) - return(PyLong)res; - throw Py.TypeError("__long__"+" returned non-"+"long"+" (type "+res.getType().fastGetName()+")"); - } - return super.__long__(); - } - public PyComplex __complex__() { PyType self_type=getType(); PyObject impl=self_type.lookup("__complex__"); @@ -678,6 +666,18 @@ return super.__int__(); } + public PyObject __long__() { + PyType self_type=getType(); + PyObject impl=self_type.lookup("__long__"); + if (impl!=null) { + PyObject res=impl.__get__(this,self_type).__call__(); + if (res instanceof PyLong||res instanceof PyInteger) + return res; + throw Py.TypeError("__long__"+" returned non-"+"long"+" (type "+res.getType().fastGetName()+")"); + } + return super.__long__(); + } + public int hashCode() { PyType self_type=getType(); PyObject impl=self_type.lookup("__hash__"); Modified: trunk/jython/src/org/python/core/PyFileDerived.java =================================================================== --- trunk/jython/src/org/python/core/PyFileDerived.java 2008-06-20 08:28:26 UTC (rev 4699) +++ trunk/jython/src/org/python/core/PyFileDerived.java 2008-06-20 08:29:23 UTC (rev 4700) @@ -102,18 +102,6 @@ return super.__float__(); } - public PyLong __long__() { - PyType self_type=getType(); - PyObject impl=self_type.lookup("__long__"); - if (impl!=null) { - PyObject res=impl.__get__(this,self_type).__call__(); - if (res instanceof PyLong) - return(PyLong)res; - throw Py.TypeError("__long__"+" returned non-"+"long"+" (type "+res.getType().fastGetName()+")"); - } - return super.__long__(); - } - public PyComplex __complex__() { PyType self_type=getType(); PyObject impl=self_type.lookup("__complex__"); @@ -678,6 +666,18 @@ return super.__int__(); } + public PyObject __long__() { + PyType self_type=getType(); + PyObject impl=self_type.lookup("__long__"); + if (impl!=null) { + PyObject res=impl.__get__(this,self_type).__call__(); + if (res instanceof PyLong||res instanceof PyInteger) + return res; + throw Py.TypeError("__long__"+" returned non-"+"long"+" (type "+res.getType().fastGetName()+")"); + } + return super.__long__(); + } + public int hashCode() { PyType self_type=getType(); PyObject impl=self_type.lookup("__hash__"); Modified: trunk/jython/src/org/python/core/PyFloatDerived.java =================================================================== --- trunk/jython/src/org/python/core/PyFloatDerived.java 2008-06-20 08:28:26 UTC (rev 4699) +++ trunk/jython/src/org/python/core/PyFloatDerived.java 2008-06-20 08:29:23 UTC (rev 4700) @@ -102,18 +102,6 @@ return super.__float__(); } - public PyLong __long__() { - PyType self_type=getType(); - PyObject impl=self_type.lookup("__long__"); - if (impl!=null) { - PyObject res=impl.__get__(this,self_type).__call__(); - if (res instanceof PyLong) - return(PyLong)res; - throw Py.TypeError("__long__"+" returned non-"+"long"+" (type "+res.getType().fastGetName()+")"); - } - return super.__long__(); - } - public PyComplex __complex__() { PyType self_type=getType(); PyObject impl=self_type.lookup("__complex__"); @@ -678,6 +666,18 @@ return super.__int__(); } + public PyObject __long__() { + PyType self_type=getType(); + PyObject impl=self_type.lookup("__long__"); + if (impl!=null) { + PyObject res=impl.__get__(this,self_type).__call__(); + if (res instanceof PyLong||res instanceof PyInteger) + return res; + throw Py.TypeError("__long__"+" returned non-"+"long"+" (type "+res.getType().fastGetName()+")"); + } + return super.__long__(); + } + public int hashCode() { PyType self_type=getType(); PyObject impl=self_type.lookup("__hash__"); Modified: trunk/jython/src/org/python/core/PyFrozenSetDerived.java =================================================================== --- trunk/jython/src/org/python/core/PyFrozenSetDerived.java 2008-06-20 08:28:26 UTC (rev 4699) +++ trunk/jython/src/org/python/core/PyFrozenSetDerived.java 2008-06-20 08:29:23 UTC (rev 4700) @@ -102,18 +102,6 @@ return super.__float__(); } - public PyLong __long__() { - PyType self_type=getType(); - PyObject impl=self_type.lookup("__long__"); - if (impl!=null) { - PyObject res=impl.__get__(this,self_type).__call__(); - if (res instanceof PyLong) - return(PyLong)res; - throw Py.TypeError("__long__"+" returned non-"+"long"+" (type "+res.getType().fastGetName()+")"); - } - return super.__long__(); - } - public PyComplex __complex__() { PyType self_type=getType(); PyObject impl=self_type.lookup("__complex__"); @@ -678,6 +666,18 @@ return super.__int__(); } + public PyObject __long__() { + PyType self_type=getType(); + PyObject impl=self_type.lookup("__long__"); + if (impl!=null) { + PyObject res=impl.__get__(this,self_type).__call__(); + if (res instanceof PyLong||res instanceof PyInteger) + return res; + throw Py.TypeError("__long__"+" returned non-"+"long"+" (type "+res.getType().fastGetName()+")"); + } + return super.__long__(); + } + public int hashCode() { PyType self_type=getType(); PyObject impl=self_type.lookup("__hash__"); Modified: trunk/jython/src/org/python/core/PyIntegerDerived.java =================================================================== --- trunk/jython/src/org/python/core/PyIntegerDerived.java 2008-06-20 08:28:26 UTC (rev 4699) +++ trunk/jython/src/org/python/core/PyIntegerDerived.java 2008-06-20 08:29:23 UTC (rev 4700) @@ -102,18 +102,6 @@ return super.__float__(); } - public PyLong __long__() { - PyType self_type=getType(); - PyObject impl=self_type.lookup("__long__"); - if (impl!=null) { - PyObject res=impl.__get__(this,self_type).__call__(); - if (res instanceof PyLong) - return(PyLong)res; - throw Py.TypeError("__long__"+" returned non-"+"long"+" (type "+res.getType().fastGetName()+")"); - } - return super.__long__(); - } - public PyComplex __complex__() { PyType self_type=getType(); PyObject impl=self_type.lookup("__complex__"); @@ -678,6 +666,18 @@ return super.__int__(); } + public PyObject __long__() { + PyType self_type=getType(); + PyObject impl=self_type.lookup("__long__"); + if (impl!=null) { + PyObject res=impl.__get__(this,self_type).__call__(); + if (res instanceof PyLong||res instanceof PyInteger) + return res; + throw Py.TypeError("__long__"+" returned non-"+"long"+" (type "+res.getType().fastGetName()+")"); + } + return super.__long__(); + } + public int hashCode() { PyType self_type=getType(); PyObject impl=self_type.lookup("__hash__"); Modified: trunk/jython/src/org/python/core/PyListDerived.java =================================================================== --- trunk/jython/src/org/python/core/PyListDerived.java 2008-06-20 08:28:26 UTC (rev 4699) +++ trunk/jython/src/org/python/core/PyListDerived.java 2008-06-20 08:29:23 UTC (rev 4700) @@ -102,18 +102,6 @@ return super.__float__(); } - public PyLong __long__() { - PyType self_type=getType(); - PyObject impl=self_type.lookup("__long__"); - if (impl!=null) { - PyObject res=impl.__get__(this,self_type).__call__(); - if (res instanceof PyLong) - return(PyLong)res; - throw Py.TypeError("__long__"+" returned non-"+"long"+" (type "+res.getType().fastGetName()+")"); - } - return super.__long__(); - } - public PyComplex __complex__() { PyType self_type=getType(); PyObject impl=self_type.lookup("__complex__"); @@ -678,6 +666,18 @@ return super.__int__(); } + public PyObject __long__() { + PyType self_type=getType(); + PyObject impl=self_type.lookup("__long__"); + if (impl!=null) { + PyObject res=impl.__get__(this,self_type).__call__(); + if (res instanceof PyLong||res instanceof PyInteger) + return res; + throw Py.TypeError("__long__"+" returned non-"+"long"+" (type "+res.getType().fastGetName()+")"); + } + return super.__long__(); + } + public int hashCode() { PyType self_type=getType(); PyObject impl=self_type.lookup("__hash__"); Modified: trunk/jython/src/org/python/core/PyLongDerived.java =================================================================== --- trunk/jython/src/org/python/core/PyLongDerived.java 2008-06-20 08:28:26 UTC (rev 4699) +++ trunk/jython/src/org/python/core/PyLongDerived.java 2008-06-20 08:29:23 UTC (rev 4700) @@ -102,18 +102,6 @@ return super.__float__(); } - public PyLong __long__() { - PyType self_type=getType(); - PyObject impl=self_type.lookup("__long__"); - if (impl!=null) { - PyObject res=impl.__get__(this,self_type).__call__(); - if (res instanceof PyLong) - return(PyLong)res; - throw Py.TypeError("__long__"+" returned non-"+"long"+" (type "+res.getType().fastGetName()+")"); - } - return super.__long__(); - } - public PyComplex __complex__() { PyType self_type=getType(); PyObject impl=self_type.lookup("__complex__"); @@ -678,6 +666,18 @@ return super.__int__(); } + public PyObject __long__() { + PyType self_type=getType(); + PyObject impl=self_type.lookup("__long__"); + if (impl!=null) { + PyObject res=impl.__get__(this,self_type).__call__(); + if (res instanceof PyLong||res instanceof PyInteger) + return res; + throw Py.TypeError("__long__"+" returned non-"+"long"+" (type "+res.getType().fastGetName()+")"); + } + return super.__long__(); + } + public int hashCode() { PyType self_type=getType(); PyObject impl=self_type.lookup("__hash__"); Modified: trunk/jython/src/org/python/core/PyModuleDerived.java =================================================================== --- trunk/jython/src/org/python/core/PyModuleDerived.java 2008-06-20 08:28:26 UTC (rev 4699) +++ trunk/jython/src/org/python/core/PyModuleDerived.java 2008-06-20 08:29:23 UTC (rev 4700) @@ -78,18 +78,6 @@ return super.__float__(); } - public PyLong __long__() { - PyType self_type=getType(); - PyObject impl=self_type.lookup("__long__"); - if (impl!=null) { - PyObject res=impl.__get__(this,self_type).__call__(); - if (res instanceof PyLong) - return(PyLong)res; - throw Py.TypeError("__long__"+" returned non-"+"long"+" (type "+res.getType().fastGetName()+")"); - } - return super.__long__(); - } - public PyComplex __complex__() { PyType self_type=getType(); PyObject impl=self_type.lookup("__complex__"); @@ -654,6 +642,18 @@ return super.__int__(); } + public PyObject __long__() { + PyType self_type=getType(); + PyObject impl=self_type.lookup("__long__"); + if (impl!=null) { + PyObject res=impl.__get__(this,self_type).__call__(); + if (res instanceof PyLong||res instanceof PyInteger) + return res; + throw Py.TypeError("__long__"+" returned non-"+"long"+" (type "+res.getType().fastGetName()+")"); + } + return super.__long__(); + } + public int hashCode() { PyType self_type=getType(); PyObject impl=self_type.lookup("__hash__"); Modified: trunk/jython/src/org/python/core/PyObjectDerived.java =================================================================== --- trunk/jython/src/org/python/core/PyObjectDerived.java 2008-06-20 08:28:26 UTC (rev 4699) +++ trunk/jython/src/org/python/core/PyObjectDerived.java 2008-06-20 08:29:23 UTC (rev 4700) @@ -102,18 +102,6 @@ return super.__float__(); } - public PyLong __long__() { - PyType self_type=getType(); - PyObject impl=self_type.lookup("__long__"); - if (impl!=null) { - PyObject res=impl.__get__(this,self_type).__call__(); - if (res instanceof PyLong) - return(PyLong)res; - throw Py.TypeError("__long__"+" returned non-"+"long"+" (type "+res.getType().fastGetName()+")"); - } - return super.__long__(); - } - public PyComplex __complex__() { PyType self_type=getType(); PyObject impl=self_type.lookup("__complex__"); @@ -678,6 +666,18 @@ return super.__int__(); } + public PyObject __long__() { + PyType self_type=getType(); + PyObject impl=self_type.lookup("__long__"); + if (impl!=null) { + PyObject res=impl.__get__(this,self_type).__call__(); + if (res instanceof PyLong||res instanceof PyInteger) + return res; + throw Py.TypeError("__long__"+" returned non-"+"long"+" (type "+res.getType().fastGetName()+")"); + } + return super.__long__(); + } + public int hashCode() { PyType self_type=getType(); PyObject impl=self_type.lookup("__hash__"); Modified: trunk/jython/src/org/python/core/PyPropertyDerived.java =================================================================== --- trunk/jython/src/org/python/core/PyPropertyDerived.java 2008-06-20 08:28:26 UTC (rev 4699) +++ trunk/jython/src/org/python/core/PyPropertyDerived.java 2008-06-20 08:29:23 UTC (rev 4700) @@ -102,18 +102,6 @@ return super.__float__(); } - public PyLong __long__() { - PyType self_type=getType(); - PyObject impl=self_type.lookup("__long__"); - if (impl!=null) { - PyObject res=impl.__get__(this,self_type).__call__(); - if (res instanceof PyLong) - return(PyLong)res; - throw Py.TypeError("__long__"+" returned non-"+"long"+" (type "+res.getType().fastGetName()+")"); - } - return super.__long__(); - } - public PyComplex __complex__() { PyType self_type=getType(); PyObject impl=self_type.lookup("__complex__"); @@ -678,6 +666,18 @@ return super.__int__(); } + public PyObject __long__() { + PyType self_type=getType(); + PyObject impl=self_type.lookup("__long__"); + if (impl!=null) { + PyObject res=impl.__get__(this,self_type).__call__(); + if (res instanceof PyLong||res instanceof PyInteger) + return res; + throw Py.TypeError("__long__"+" returned non-"+"long"+" (type "+res.getType().fastGetName()+")"); + } + return super.__long__(); + } + public int hashCode() { PyType self_type=getType(); PyObject impl=self_type.lookup("__hash__"); Modified: trunk/jython/src/org/python/core/PySetDerived.java =================================================================== --- trunk/jython/src/org/python/core/PySetDerived.java 2008-06-20 08:28:26 UTC (rev 4699) +++ trunk/jython/src/org/python/core/PySetDerived.java 2008-06-20 08:29:23 UTC (rev 4700) @@ -102,18 +102,6 @@ return super.__float__(); } - public PyLong __long__() { - PyType self_type=getType(); - PyObject impl=self_type.lookup("__long__"); - if (impl!=null) { - PyObject res=impl.__get__(this,self_type).__call__(); - if (res instanceof PyLong) - return(PyLong)res; - throw Py.TypeError("__long__"+" returned non-"+"long"+" (type "+res.getType().fastGetName()+")"); - } - return super.__long__(); - } - public PyComplex __complex__() { PyType self_type=getType(); PyObject impl=self_type.lookup("__complex__"); @@ -678,6 +666,18 @@ return super.__int__(); } + public PyObject __long__() { + PyType self_type=getType(); + PyObject impl=self_type.lookup("__long__"); + if (impl!=null) { + PyObject res=impl.__get__(this,self_type).__call__(); + if (res instanceof PyLong||res instanceof PyInteger) + return res; + throw Py.TypeError("__long__"+" returned non-"+"long"+" (type "+res.getType().fastGetName()+")"); + } + return super.__long__(); + } + public int hashCode() { PyType self_type=getType(); PyObject impl=self_type.lookup("__hash__"); Modified: trunk/jython/src/org/python/core/PySliceDerived.java =================================================================== --- trunk/jython/src/org/python/core/PySliceDerived.java 2008-06-20 08:28:26 UTC (rev 4699) +++ trunk/jython/src/org/python/core/PySliceDerived.java 2008-06-20 08:29:23 UTC (rev 4700) @@ -102,18 +102,6 @@ return super.__float__(); } - public PyLong __long__() { - PyType self_type=getType(); - PyObject impl=self_type.lookup("__long__"); - if (impl!=null) { - PyObject res=impl.__get__(this,self_type).__call__(); - if (res instanceof PyLong) - return(PyLong)res; - throw Py.TypeError("__long__"+" returned non-"+"long"+" (type "+res.getType().fastGetName()+")"); - } - return super.__long__(); - } - public PyComplex __complex__() { PyType self_type=getType(); PyObject impl=self_type.lookup("__complex__"); @@ -678,6 +666,18 @@ return super.__int__(); } + public PyObject __long__() { + PyType self_type=getType(); + PyObject impl=self_type.lookup("__long__"); + if (impl!=null) { + PyObject res=impl.__get__(this,self_type).__call__(); + if (res instanceof PyLong||res instanceof PyInteger) + return res; + throw Py.TypeError("__long__"+" returned non-"+"long"+" (type "+res.getType().fastGetName()+")"); + } + return super.__long__(); + } + public int hashCode() { PyType self_type=getType(); PyObject impl=self_type.lookup("__hash__"); Modified: trunk/jython/src/org/python/core/PyStringDerived.java =================================================================== --- trunk/jython/src/org/python/core/PyStringDerived.java 2008-06-20 08:28:26 UTC (rev 4699) +++ trunk/jython/src/org/python/core/PyStringDerived.java 2008-06-20 08:29:23 UTC (rev 4700) @@ -102,18 +102,6 @@ return super.__float__(); } - public PyLong __long__() { - PyType self_type=getType(); - PyObject impl=self_type.lookup("__long__"); - if (impl!=null) { - PyObject res=impl.__get__(this,self_type).__call__(); - if (res instanceof PyLong) - return(PyLong)res; - throw Py.TypeError("__long__"+" returned non-"+"long"+" (type "+res.getType().fastGetName()+")"); - } - return super.__long__(); - } - public PyComplex __complex__() { PyType self_type=getType(); PyObject impl=self_type.lookup("__complex__"); @@ -678,6 +666,18 @@ return super.__int__(); } + public PyObject __long__() { + PyType self_type=getType(); + PyObject impl=self_type.lookup("__long__"); + if (impl!=null) { + PyObject res=impl.__get__(this,self_type).__call__(); + if (res instanceof PyLong||res instanceof PyInteger) + return res; + throw Py.TypeError("__long__"+" returned non-"+"long"+" (type "+res.getType().fastGetName()+")"); + } + return super.__long__(); + } + public int hashCode() { PyType self_type=getType(); PyObject impl=self_type.lookup("__hash__"); Modified: trunk/jython/src/org/python/core/PySuperDerived.java =================================================================== --- trunk/jython/src/org/python/core/PySuperDerived.java 2008-06-20 08:28:26 UTC (rev 4699) +++ trunk/jython/src/org/python/core/PySuperDerived.java 2008-06-20 08:29:23 UTC (rev 4700) @@ -102,18 +102,6 @@ return super.__float__(); } - public PyLong __long__() { - PyType self_type=getType(); - PyObject impl=self_type.lookup("__long__"); - if (impl!=null) { - PyObject res=impl.__get__(this,self_type).__call__(); - if (res instanceof PyLong) - return(PyLong)res; - throw Py.TypeError("__long__"+" returned non-"+"long"+" (type "+res.getType().fastGetName()+")"); - } - return super.__long__(); - } - public PyComplex __complex__() { PyType self_type=getType(); PyObject impl=self_type.lookup("__complex__"); @@ -678,6 +666,18 @@ return super.__int__(); } + public PyObject __long__() { + PyType self_type=getType(); + PyObject impl=self_type.lookup("__long__"); + if (impl!=null) { + PyObject res=impl.__get__(this,self_type).__call__(); + if (res instanceof PyLong||res instanceof PyInteger) + return res; + throw Py.TypeError("__long__"+" returned non-"+"long"+" (type "+res.getType().fastGetName()+")"); + } + return super.__long__(); + } + public int hashCode() { PyType self_type=getType(); PyObject impl=self_type.lookup("__hash__"); Modified: trunk/jython/src/org/python/core/PyTupleDerived.java =================================================================== --- trunk/jython/src/org/python/core/PyTupleDerived.java 2008-06-20 08:28:26 UTC (rev 4699) +++ trunk/jython/src/org/python/core/PyTupleDerived.java 2008-06-20 08:29:23 UTC (rev 4700) @@ -102,18 +102,6 @@ return super.__float__(); } - public PyLong __long__() { - PyType self_type=getType(); - PyObject impl=self_type.lookup("__long__"); - if (impl!=null) { - PyObject res=impl.__get__(this,self_type).__call__(); - if (res instanceof PyLong) - return(PyLong)res; - throw Py.TypeError("__long__"+" returned non-"+"long"+" (type "+res.getType().fastGetName()+")"); - } - return super.__long__(); - } - public PyComplex __complex__() { PyType self_type=getType(); PyObject impl=self_type.lookup("__complex__"); @@ -678,6 +666,18 @@ return super.__int__(); } + public PyObject __long__() { + PyType self_type=getType(); + PyObject impl=self_type.lookup("__long__"); + if (impl!=null) { + PyObject res=impl.__get__(this,self_type).__call__(); + if (res instanceof PyLong||res instanceof PyInteger) + return res; + throw Py.TypeError("__long__"+" returned non-"+"long"+" (type "+res.getType().fastGetName()+")"); + } + return super.__long__(); + } + public int hashCode() { PyType self_type=getType(); PyObject impl=self_type.lookup("__hash__"); Modified: trunk/jython/src/org/python/core/PyTypeDerived.java =================================================================== --- trunk/jython/src/org/python/core/PyTypeDerived.java 2008-06-20 08:28:26 UTC (rev 4699) +++ trunk/jython/src/org/python/core/PyTypeDerived.java 2008-06-20 08:29:23 UTC (rev 4700) @@ -78,18 +78,6 @@ return super.__float__(); } - public PyLong __long__() { - PyType self_type=getType(); - PyObject impl=self_type.lookup("__long__"); - if (impl!=null) { - PyObject res=impl.__get__(this,self_type).__call__(); - if (res instanceof PyLong) - return(PyLong)res; - throw Py.TypeError("__long__"+" returned non-"+"long"+" (type "+res.getType().fastGetName()+")"); - } - return super.__long__(); - } - public PyComplex __complex__() { PyType self_type=getType(); PyObject impl=self_type.lookup("__complex__"); @@ -654,6 +642,18 @@ return super.__int__(); } + public PyObject __long__() { + PyType self_type=getType(); + PyObject impl=self_type.lookup("__long__"); + if (impl!=null) { + PyObject res=impl.__get__(this,self_type).__call__(); + if (res instanceof PyLong||res instanceof PyInteger) + return res; + throw Py.TypeError("__long__"+" returned non-"+"long"+" (type "+res.getType().fastGetName()+")"); + } + return super.__long__(); + } + public int hashCode() { PyType self_type=getType(); PyObject impl=self_type.lookup("__hash__"); Modified: trunk/jython/src/org/python/core/PyUnicodeDerived.java =================================================================== --- trunk/jython/src/org/python/core/PyUnicodeDerived.java 2008-06-20 08:28:26 UTC (rev 4699) +++ trunk/jython/src/org/python/core/PyUnicodeDerived.java 2008-06-20 08:29:23 UTC (rev 4700) @@ -102,18 +102,6 @@ return super.__float__(); } - public PyLong __long__() { - PyType self_type=getType(); - PyObject impl=self_type.lookup("__long__"); - if (impl!=null) { - PyObject res=impl.__get__(this,self_type).__call__(); - if (res instanceof PyLong) - return(PyLong)res; - throw Py.TypeError("__long__"+" returned non-"+"long"+" (type "+res.getType().fastGetName()+")"); - } - return super.__long__(); - } - public PyComplex __complex__() { PyType self_type=getType(); PyObject impl=self_type.lookup("__complex__"); @@ -678,6 +666,18 @@ return super.__int__(); } + public PyObject __long__() { + PyType self_type=getType(); + PyObject impl=self_type.lookup("__long__"); + if (impl!=null) { + PyObject res=impl.__get__(this,self_type).__call__(); + if (res instanceof PyLong||res instanceof PyInteger) + return res; + throw Py.TypeError("__long__"+" returned non-"+"long"+" (type "+res.getType().fastGetName()+")"); + } + return super.__long__(); + } + public int hashCode() { PyType self_type=getType(); PyObject impl=self_type.lookup("__hash__"); Modified: trunk/jython/src/org/python/modules/_weakref/ReferenceTypeDerived.java =================================================================== --- trunk/jython/src/org/python/modules/_weakref/ReferenceTypeDerived.java 2008-06-20 08:28:26 UTC (rev 4699) +++ trunk/jython/src/org/python/modules/_weakref/ReferenceTypeDerived.java 2008-06-20 08:29:23 UTC (rev 4700) @@ -104,18 +104,6 @@ return super.__float__(); } - public PyLong __long__() { - PyType self_type=getType(); - PyObject impl=self_type.lookup("__long__"); - if (impl!=null) { - PyObject res=impl.__get__(this,self_type).__call__(); - if (res instanceof PyLong) - return(PyLong)res; - throw Py.TypeError("__long__"+" returned non-"+"long"+" (type "+res.getType().fastGetName()+")"); - } - return super.__long__(); - } - public PyComplex __complex__() { PyType self_type=getType(); PyObject impl=self_type.lookup("__complex__"); @@ -680,6 +668,18 @@ return super.__int__(); } + public PyObject __long__() { + PyType self_type=getType(); + PyObject impl=self_type.lookup("__long__"); + if (impl!=null) { + PyObject res=impl.__get__(this,self_type).__call__(); + if (res instanceof PyLong||res instanceof PyInteger) + return res; + throw Py.TypeError("__long__"+" returned non-"+"long"+" (type "+res.getType().fastGetName()+")"); + } + return super.__long__(); + } + public int hashCode() { PyType self_type=getType(); PyObject impl=self_type.lookup("__hash__"); Modified: trunk/jython/src/org/python/modules/collections/PyDefaultDictDerived.java =================================================================== --- trunk/jython/src/org/python/modules/collections/PyDefaultDictDerived.java 2008-06-20 08:28:26 UTC (rev 4699) +++ trunk/jython/src/org/python/modules/collections/PyDefaultDictDerived.java 2008-06-20 08:29:23 UTC (rev 4700) @@ -104,18 +104,6 @@ return super.__float__(); } - public PyLong __long__() { - PyType self_type=getType(); - PyObject impl=self_type.lookup("__long__"); - if (impl!=null) { - PyObject res=impl.__get__(this,self_type).__call__(); - if (res instanceof PyLong) - return(PyLong)res; - throw Py.TypeError("__long__"+" returned non-"+"long"+" (type "+res.getType().fastGetName()+")"); - } - return super.__long__(); - } - public PyComplex __complex__() { PyType self_type=getType(); PyObject impl=self_type.lookup("__complex__"); @@ -680,6 +668,18 @@ return super.__int__(); } + public PyObject __long__() { + PyType self_type=getType(); + PyObject impl=self_type.lookup("__long__"); + if (impl!=null) { + PyObject res=impl.__get__(this,self_type).__call__(); + if (res instanceof PyLong||res instanceof PyInteger) + return res; + throw Py.TypeError("__long__"+" returned non-"+"long"+" (type "+res.getType().fastGetName()+")"); + } + return super.__long__(); + } + public int hashCode() { PyType self_type=getType(); PyObject impl=self_type.lookup("__hash__"); Modified: trunk/jython/src/org/python/modules/collections/PyDequeDerived.java =================================================================== --- trunk/jython/src/org/python/modules/collections/PyDequeDerived.java 2008-06-20 08:28:26 UTC (rev 4699) +++ trunk/jython/src/org/python/modules/collections/PyDequeDerived.java 2008-06-20 08:29:23 UTC (rev 4700) @@ -104,18 +104,6 @@ return super.__float__(); } - public PyLong __long__() { - PyType self_type=getType(); - PyObject impl=self_type.lookup("__long__"); - if (impl!=null) { - PyObject res=impl.__get__(this,self_type).__call__(); - if (res instanceof PyLong) - return(PyLong)res; - throw Py.TypeError("__long__"+" returned non-"+"long"+" (type "+res.getType().fastGetName()+")"); - } - return super.__long__(); - } - public PyComplex __complex__() { PyType self_type=getType(); PyObject impl=self_type.lookup("__complex__"); @@ -680,6 +668,18 @@ return super.__int__(); } + public PyObject __long__() { + PyType self_type=getType(); + PyObject impl=self_type.lookup("__long__"); + if (impl!=null) { + PyObject res=impl.__get__(this,self_type).__call__(); + if (res instanceof PyLong||res instanceof PyInteger) + return res; + throw Py.TypeError("__long__"+" returned non-"+"long"+" (type "+res.getType().fastGetName()+")"); + } + return super.__long__(); + } + public int hashCode() { PyType self_type=getType(); PyObject impl=self_type.lookup("__hash__"); Modified: trunk/jython/src/org/python/modules/random/PyRandomDerived.java =================================================================== --- trunk/jython/src/org/python/modules/random/PyRandomDerived.java 2008-06-20 08:28:26 UTC (rev 4699) +++ trunk/jython/src/org/python/modules/random/PyRandomDerived.java 2008-06-20 08:29:23 UTC (rev 4700) @@ -104,18 +104,6 @@ return super.__float__(); } - public PyLong __long__() { - PyType self_type=getType(); - PyObject impl=self_type.lookup("__long__"); - if (impl!=null) { - PyObject res=impl.__get__(this,self_type).__call__(); - if (res instanceof PyLong) - return(PyLong)res; - throw Py.TypeError("__long__"+" returned non-"+"long"+" (type "+res.getType().fastGetName()+")"); - } - return super.__long__(); - } - public PyComplex __complex__() { PyType self_type=getType(); PyObject impl=self_type.lookup("__complex__"); @@ -680,6 +668,18 @@ return super.__int__(); } + public PyObject __long__() { + PyType self_type=getType(); + PyObject impl=self_type.lookup("__long__"); + if (impl!=null) { + PyObject res=impl.__get__(this,self_type).__call__(); + if (res instanceof PyLong||res instanceof PyInteger) + return res; + throw Py.TypeError("__long__"+" returned non-"+"long"+" (type "+res.getType().fastGetName()+")"); + } + return super.__long__(); + } + public int hashCode() { PyType self_type=getType(); PyObject impl=self_type.lookup("__hash__"); Modified: trunk/jython/src/org/python/modules/thread/PyLocalDerived.java =================================================================== --- trunk/jython/src/org/python/modules/thread/PyLocalDerived.java 2008-06-20 08:28:26 UTC (rev 4699) +++ trunk/jython/src/org/python/modules/thread/PyLocalDerived.java 2008-06-20 08:29:23 UTC (rev 4700) @@ -80,18 +80,6 @@ return super.__float__(); } - public PyLong __long__() { - PyType self_type=getType(); - PyObject impl=self_type.lookup("__long__"); - if (impl!=null) { - PyObject res=impl.__get__(this,self_type).__call__(); - if (res instanceof PyLong) - return(PyLong)res; - throw Py.TypeError("__long__"+" returned non-"+"long"+" (type "+res.getType().fastGetName()+")"); - } - return super.__long__(); - } - public PyComplex __complex__() { PyType self_type=getType(); PyObject impl=self_type.lookup("__complex__"); @@ -656,6 +644,18 @@ return super.__int__(); } + public PyObject __long__() { + PyType self_type=getType(); + PyObject impl=self_type.lookup("__long__"); + if (impl!=null) { + PyObject res=impl.__get__(this,self_type).__call__(); + if (res instanceof PyLong||res instanceof PyInteger) + return res; + throw Py.TypeError("__long__"+" returned non-"+"long"+" (type "+res.getType().fastGetName()+")"); + } + return super.__long__(); + } + public int hashCode() { PyType self_type=getType(); PyObject impl=self_type.lookup("__hash__"); Modified: trunk/jython/src/org/python/modules/zipimport/zipimporterDerived.java =================================================================== --- trunk/jython/src/org/python/modules/zipimport/zipimporterDerived.java 2008-06-20 08:28:26 UTC (rev 4699) +++ trunk/jython/src/org/python/modules/zipimport/zipimporterDerived.java 2008-06-20 08:29:23 UTC (rev 4700) @@ -80,18 +80,6 @@ return super.__float__(); } - public PyLong __long__() { - PyType self_type=getType(); - PyObject impl=self_type.lookup("__long__"); - if (impl!=null) { - PyObject res=impl.__get__(this,self_type).__call__(); - if (res instanceof PyLong) - return(PyLong)res; - throw Py.TypeError("__long__"+" returned non-"+"long"+" (type "+res.getType().fastGetName()+")"); - } - return super.__long__(); - } - public PyComplex __complex__() { PyType self_type=getType(); PyObject impl=self_type.lookup("__complex__"); @@ -656,6 +644,18 @@ return super.__int__(); } + public PyObject __long__() { + PyType self_type=getType(); + PyObject impl=self_type.lookup("__long__"); + if (impl!=null) { + PyObject res=impl.__get__(this,self_type).__call__(); + if (res instanceof PyLong||res instanceof PyInteger) + return res; + throw Py.TypeError("__long__"+" returned non-"+"long"+" (type "+res.getType().fastGetName()+")"); + } + return super.__long__(); + } + public int hashCode() { PyType self_type=getType(); PyObject impl=self_type.lookup("__hash__"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |