-
Notifications
You must be signed in to change notification settings - Fork 99
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
Python collections are not iterable as Java Collections #260
Comments
Hi @wdobler, thank you for your interest in graalpython. It should indeed be possible to pass python collections to methods taking |
Thanks for the clarification. If there is anything I can do myself, I'd be interested to know. Like
|
I already opened an issue for Truffle internally. I was told that they plan to add a wrapper for If you wanted to play with the code yourself, I think a good starting point would be the |
Truffle added support for mapping |
So I read about this just now due to the blog news here: https://medium.com/graalvm/whats-new-in-truffle-and-graal-languages-40027a59c401 For instance: "Improved Array Access. We added the ability to use Value#as(Collection.class) to map guest language arrays (Value#hasArrayElements()) to the Java Collection interface" GraalVM has very helpful and useful documentation available at: https://www.graalvm.org/latest/docs/ Do the docs also include one or two example in how to use that specifically? That is the (Value#hasArrayElements()). I am just asking in the event no example covers that yet; if it is covered then please disregard my question here. |
@rubyFeedback Truffle's javadoc documents the |
In graal-22.0.0.2, there is some mismatch between Python collection types and
Java
Collection
s andIterable
s.A Java method that expects a
Collection
argument cannot iterate over thatargument when it is a Python
list
orset
.A Java method that expects an
Iterable
works fine:Given that
Collection<T>
implementsIterable<T>
, iterating over arbitraryCollections should be possible.
The text was updated successfully, but these errors were encountered: