Some python types (in particular GenericAlias and Union) cannot be handled by the default ->jvm handler.
Note on tests: The only way I could find to instantiate an object of type types.UnionType for testing is directly with python syntax and the | operator. I don't know of a way to test objects created via syntax without creating global variables in the python interpreter (e.g. with run-simple-string). For that reason, I've left the test for this out for now. I have tested by hand. Suggestions for good approaches to this welcome.
Note: types.UnionType is not the same as typing.Union, which can be used via __get_item__ to produces objects of type typing._UnionGenericAlias.
See issue #250.
Some python types (in particular
GenericAlias
andUnion
) cannot be handled by the default->jvm
handler.Note on tests: The only way I could find to instantiate an object of type
types.UnionType
for testing is directly with python syntax and the|
operator. I don't know of a way to test objects created via syntax without creating global variables in the python interpreter (e.g. withrun-simple-string
). For that reason, I've left the test for this out for now. I have tested by hand. Suggestions for good approaches to this welcome.Note:
types.UnionType
is not the same astyping.Union
, which can be used via__get_item__
to produces objects of typetyping._UnionGenericAlias
.