From: <pj...@us...> - 2008-06-20 00:03:01
|
Revision: 4681 http://jython.svn.sourceforge.net/jython/?rev=4681&view=rev Author: pjenvey Date: 2008-06-19 17:02:52 -0700 (Thu, 19 Jun 2008) Log Message: ----------- apply -Qnew division to derived classes, not just builtins Modified Paths: -------------- trunk/jython/src/org/python/core/PyObject.java trunk/jython/src/templates/make_binops.py Modified: trunk/jython/src/org/python/core/PyObject.java =================================================================== --- trunk/jython/src/org/python/core/PyObject.java 2008-06-19 23:50:49 UTC (rev 4680) +++ trunk/jython/src/org/python/core/PyObject.java 2008-06-20 00:02:52 UTC (rev 4681) @@ -1948,6 +1948,8 @@ * with these operands. **/ public final PyObject _div(PyObject o2) { + if (Options.Qnew) + return _truediv(o2); PyType t1=this.getType(); PyType t2=o2.getType(); if (t1==t2||t1.builtin&&t2.builtin) { @@ -1965,8 +1967,6 @@ * with these operands. **/ final PyObject _basic_div(PyObject o2) { - if (Options.Qnew) - return _truediv(o2); PyObject x=__div__(o2); if (x!=null) return x; Modified: trunk/jython/src/templates/make_binops.py =================================================================== --- trunk/jython/src/templates/make_binops.py 2008-06-19 23:50:49 UTC (rev 4680) +++ trunk/jython/src/templates/make_binops.py 2008-06-20 00:02:52 UTC (rev 4681) @@ -54,6 +54,7 @@ **/ ); public final PyObject `concat`(_, `name)(PyObject o2) { + `divhook; PyType t1 = this.getType(); PyType t2 = o2.getType(); if (t1 == t2 || t1.builtin && t2.builtin) { @@ -75,7 +76,6 @@ **/ ); final PyObject `concat`(_basic_, `name)(PyObject o2) { - `divhook; PyObject x = `concat`(__,`name,__)(o2); if (x != null) return x; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |