Closed RevolvingMadness closed 1 year ago
I am not very familiar with type hints but when I run your example it produces no errors. Here is the entire java application I tested with:
public static void main(String[] args) throws JepException {
SharedInterpreter.setConfig(new JepConfig().addIncludePaths("."));
try (SharedInterpreter interpreter = new SharedInterpreter()) {
interpreter.set("myVariable", new Object());
interpreter.exec("from pyPythonTypeHintFile import *");
interpreter.exec("x = myVariable");
interpreter.exec("print(x)");
}
}
And my pyPythonTypeHintFile.py contains only one line:
myVariable: object
The output from the java application is java.lang.Object@7aec35a
, which is what I would expect for a Java Object.
Well, I guess this is just an issue on my end. Sorry about that
Describe the problem I wrote a simple JEP program that sets a variable that references a variable in java, so you can access it from python and I also wrote a python file that declares that variable with its type hint but it doesn't work now because when I import the type hint file, it overrides the variable that i declared in java. If that doesnt make any sense let me show you: My java code:
My python type hint code:
My python code:
Once again, the type hint file overrides the declared variable in java, so I cannot use the variable declared in java.
Environment (please complete the following information):