-
Notifications
You must be signed in to change notification settings - Fork 185
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
Polyglot unable to evaluate python dictionary objects #3630
Comments
Thanks for the report, it seems an issue of Running it outside of IRB gives a clearer error: p :START
h = Polyglot.eval("python", '{"key1": "value1"}')
p :OK
p h
|
We can see better what's going on with: h = Polyglot.eval("python", '{"key1": "value1"}')
puts h
p h.class.ancestors
iterator = Truffle::Interop.hash_entries_iterator(h)
p iterator.class.ancestors
iterator2 = Truffle::Interop.iterator(iterator)
p iterator.equal?(iterator2)
p iterator.method(:each)
# p h which gives
The truffleruby/src/main/ruby/truffleruby/core/truffle/polyglot.rb Lines 355 to 356 in a9674ee
But Truffle::Interop.iterator(self) is the same object in this case since it's both iterable and iterator.So IteratorTrait#each must be before iterable in the ancestors to fix this.
|
Fix in #3634 |
I tried using truffleruby 24.0.1 with python, but it fails evaluating python's dictionary, it works fine for arrays.
The text was updated successfully, but these errors were encountered: