Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle conversion of generic-alias and union-type types in ->jvm #251

Conversation

markgdawson
Copy link
Contributor

@markgdawson markgdawson commented Sep 5, 2023

See issue #250.

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.

@cnuernber cnuernber merged commit ad4f08c into clj-python:master Sep 5, 2023
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants