Overload of for_stmt that executes a Python for loop.
(iter_, extra_test, body, get_state, set_state, init_vars)
| 340 | |
| 341 | |
| 342 | def _py_for_stmt(iter_, extra_test, body, get_state, set_state, init_vars): |
| 343 | """Overload of for_stmt that executes a Python for loop.""" |
| 344 | del get_state, set_state |
| 345 | |
| 346 | state = init_vars |
| 347 | for target in iter_: |
| 348 | if extra_test is not None and not extra_test(*state): |
| 349 | break |
| 350 | state = body(target, *state) |
| 351 | return state |
| 352 | |
| 353 | |
| 354 | def _known_len_tf_for_stmt(iter_, extra_test, body, get_state, set_state, |