Message172899
Well, I guess Serhiy meant "neither increase nor decrease".
In the end, the exact behavior will never be clear if you don't state explicitly how it's implemented: a counter that starts at 0 and is increased on __next__ until it's equal to len(list) (as checked at every iteration step). But in general the advice should be: if you want to insert or remove elements during iteration, iterate over a copy. |
|
Date |
User |
Action |
Args |
2012-10-14 18:31:14 | georg.brandl | set | recipients:
+ georg.brandl, chris.jerdonek, docs@python, serhiy.storchaka, Ian |
2012-10-14 18:31:14 | georg.brandl | set | messageid: <1350239474.17.0.0581517384868.issue16225@psf.upfronthosting.co.za> |
2012-10-14 18:31:14 | georg.brandl | link | issue16225 messages |
2012-10-14 18:31:14 | georg.brandl | create | |
|