Message5830

Author babelmania
Recipients babelmania
Date 2010-06-22.12:59:55
SpamBayes Score 0.0049881767
Marked as misclassified No
Message-id <1277211597.77.0.882629458506.issue1622@psf.upfronthosting.co.za>
In-reply-to
Content
Given a java class that can work with PyArrays within the following methods:
class MyJava {
    MyJava(int[]);
    int[] getArray();
    PyObject __add__(PyObject);
    PyObject __radd__(PyObject);
}

Then the commutative property is lost:
   a=MyJava([1,1])
   b=jarray.array([1,1],'i')

   a+b
   b+a # ERROR

In Jython-2.1 this worked, but in Jython-2.5 an error is raised because only PyArray types can be considered in the hard-wired implementation of PyArray?

I tried to add a new PyBuiltinMethod for PyArray, but that road seems also to be blocked becuse it is considered a builtin type.


Possible workaround (other than hacking the Jython code) would also be appreciated.
History
Date User Action Args
2010-06-22 12:59:58babelmaniasetrecipients: + babelmania
2010-06-22 12:59:57babelmaniasetmessageid: <1277211597.77.0.882629458506.issue1622@psf.upfronthosting.co.za>
2010-06-22 12:59:57babelmanialinkissue1622 messages
2010-06-22 12:59:55babelmaniacreate