The with
approach would work if you use the debugger to change the current line I think.
I don't understand why this stop using ASTs in favor of buggy regexes - you're allowed to do whatever you want during the codec ...
Don't forget to handle increment before continue
.
The main time I miss C-style for loops is dealing with linked lists and when manipulating the current iteration.
The former should be easy enough - make the advancement provide __getattr__
expressions.
The latter already works since it is in fact being transformed into a while
. It's impossible if you try to use for
though.