Skip to content

v0.3.0

Compare
Choose a tag to compare
@philippedistributive philippedistributive released this 26 Jan 16:06
· 795 commits to main since this release
52039ad

Our JS Proxies now implement all Array and Object methods on Python Lists and Dicts, and our Python List and Dict subtypes implements operators and methods on JS Arrays and Objects.

One can now do

items = [1, 2, 3, 4, 5]
result = [None]
pm.eval("(result, arr) => {result[0] = arr.some((element) => element % 2 === 0)}")(result, items)
-> result[0] == True

and going the other way

a = pm.eval("([1,2,3,4,5,6])")
b = a[1:5]
-> b == [2,3,4,5]   

We also have all the iterators returned by such methods as values() now working without making copies of the object being iterated upon