Closed chipkent closed 1 year ago
The 1st example works as expected, Python array interference only support component types that are either primitive, or String, Boolean, Instant. Everything else will be treated as a scalar org.jpy.PyObject.
The 2nd example contains two user mistakes, specifically, f3
needs to be called with f3(i)
, and inside the body of f3
, i%0 == 0
should probably be i%3 == 0
. After correcting them, the code runs through.
The second example contains a 3rd and bigger mistake. Tuple[C]
inciates that the type should only contain a tuple with a single value, which Python simplifies to the single value. Instead, what is being returned does not match the type hint.
DH queries seem to have a hard time correctly inferring the type if the return value is a tuple containing a single element, even if the type hint is correct.
Similarly, if this code is run, an exception is triggered:
With the error: