Closed jep-learner closed 1 year ago
Java Maps are not converted to dicts and while some dict functionality is added by jep they are not completely interchangeable. You can write python code to convert the map to a dict. You could use Map.forEach() to convert a map to a dict without much code:
interp.exec("real_param_dict = {}")
interp.exec("param_dict.forEach(lambda k,v: real_param_dict.update({k:v}))"
interp.exec("param_dict = real_param_dict")
There is some more information on working with maps in python in this post.
Thank you!
Describe the problem I am having a problem passing an object of type
HashMap
as an argument of typedict
.Python module
testdict
:Java class:
Exception:
Could you please advise how to fix this issue on the Java side? The Python function signature can not be changed.
Thank you.
Environment (please complete the following information):