You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Python version of the built-in next() function supports a 2nd argument whose value is returned when the iterator is exhausted instead of raising a StopIteration exception. This 2nd argument is currently ignored by Transcrypt:
exportfunctionpy_next(iterator){// Called only in a Python context, could receive Python or JavaScript iteratortry{// Primarily assume Python iterator, for max speedvarresult=iterator.__next__();}catch(exception){// JavaScript iterators are the exception herevarresult=iterator.next();if(result.done){throwStopIteration(newError());}else{returnresult.value;}}if(result==undefined){throwStopIteration(newError());}else{returnresult;}}
The text was updated successfully, but these errors were encountered:
The Python version of the built-in
next()
function supports a 2nd argument whose value is returned when the iterator is exhausted instead of raising aStopIteration
exception. This 2nd argument is currently ignored by Transcrypt:The text was updated successfully, but these errors were encountered: