Skip to content

Navigation Menu

Sign in
Sign up

v0.5.0 #318

Apr 15, 2024 · 0 comments
Discussion options

PythonMonkey v0.5.0

  • fixed a bug where pmjs -e / pmjs -p was not able to call functions that require the event loop
  • implemented setInterval and clearInterval
  • implemented further cross-language support for iterators (the more wide spread use of iterators, i.e. the for-of loop was already working in previous versions)

using a JS iterator in python:

import pythonmonkey as pm
myit = pm.eval('(function* () { yield 1; yield 2; })')()
print(next(myit)) # 1.0
print(next(myit)) # 2.0
print(next(myit)) # StopIteration exception

using a python iterator in JS:

import pythonmonkey as pm
myit = iter((1,2))
pm.eval("""
(myit) => {
 console.log([...myit]); // [1, 2]
}
""")(myit)

This discussion was created from the release v0.5.0.
You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /