Message5760
Consider the following Java class:
------------
public class Bar {
public PyObject __call__(float x) {
return dump(x);
}
public PyObject __call__(double x) {
return dump(x);
}
public PyObject __call__(PyComplex x) {
return dump(x);
}
private PyObject dump(Object o) {
System.out.println("called with "+o.getClass()+"="+o);
return Py.None;
}
}
------------
calling this demo class in Jython as follows:
$ foo=Bar();
$ foo(2.);
called with class java.lang.Double=2.0
$ foo(1+2j);
TypeError: can't convert complex to float; use e.g. abs(z)
------------
This worked in Jython 2.1 and it seems that Jython 2.5.1 is broken in this respect. |
|
Date |
User |
Action |
Args |
2010-05-06 07:59:36 | babelmania | set | recipients:
+ babelmania |
2010-05-06 07:59:36 | babelmania | set | messageid: <1273132776.81.0.828416781275.issue1605@psf.upfronthosting.co.za> |
2010-05-06 07:59:36 | babelmania | link | issue1605 messages |
2010-05-06 07:59:35 | babelmania | create | |
|