Open CHanzyLazer opened 1 week ago
Describe the bug numpy.bool_ does not automatically convert to java.lang.Boolean.
numpy.bool_
java.lang.Boolean
To Reproduce
try (SharedInterpreter inter = new SharedInterpreter()) { inter.exec("import numpy as np"); Object pyBool = inter.getValue("True"); Object npyBool = inter.getValue("np.True_"); System.out.println(pyBool.getClass()); System.out.println(npyBool.getClass()); }
Output:
class java.lang.Boolean class jep.python.PyObject
Expected behavior
class java.lang.Boolean class java.lang.Boolean
Thank you for reporting this and providing an easily reproducible test case. A workaround is to cast it to a bool in Python, like
Object npyBool = interp.getValue("bool(numpy.True_)").
Describe the bug
numpy.bool_
does not automatically convert tojava.lang.Boolean
.To Reproduce
Output:
Expected behavior
Output: