I want to get the iteration object from the loop. I want to avoid storing it in another variable and accessing it. Is there a better way to do it, something like get_current_iterator()?
for idx, number in enumerate(range(1, 10)):
# need to refer to enum object for use with
# next()
en = enumerate(range(1, 10)); for i, e in en: ...for idx, number in (en := enumerate(range(1,10))):next(en)in the loop could raise aStopIterationthat theforloop won't catch for you.