From: Eli A. <el...@ce...> - 2001-02-20 06:30:33
|
Hi. I have inherited a Jython application that makes use of user-defined java time series classes. These classes have overloaded operators that do pretty much what you would expect. For instance, given a time series x and a time series y, x+y returns a new time series with the elements of x and y added at corresponding times. These usually work fine. It would be very useful to be able to define x>y the same way. However, when I write my own __cmp__ method Jython ignores it. The results from x>y are an arbitrary scalar value, as if I had left comparisons undefined. If I call my method directly by name: x.__cmp__(y) it works fine. Can anyone explain or point to a likely omission? Thanks, Eli |