beeware / batavia

A JavaScript implementation of the Python virtual machine.
http://pybee.org/batavia
Other
1.39k stars 424 forks source link

For loops with sequence objects #763

Closed SebStreb closed 5 years ago

SebStreb commented 5 years ago

This PR is related to the issue #762 where for loops didn't work the same way as in CPython with sequence objects. I started by adding failing tests related to the issue. Then I modified the iter() builtin function and added a SequenceIterator type to handle sequence objects in for loops. With these modifications I managed to pass the tests I created.

PR Checklist: