-
Notifications
You must be signed in to change notification settings - Fork 46
v0.5.0 #318
zollqir
announced in
Announcements
v0.5.0
#318
PythonMonkey v0.5.0
- fixed a bug where
pmjs -e/pmjs -pwas 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.
All reactions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment