Message273720
I presume you are suggesting to raise if the length changes. This is similar to raising when a dict is mutated while iterating. Note that we do not do this with mutable sequences. (If the iteration is stopped with out-of-memory error, so be it.)
An alternate approach would be to first fully evaluate start, stop, step , *and then length*, to ints, in that order, before using any of them. In particular, have everything stable before comparing and adjusting start and stop to length. This way, slices would continue to always work, barring other exceptions in __index__ or __length__. |
|
Date |
User |
Action |
Args |
2016-08-26 19:21:04 | terry.reedy | set | recipients:
+ terry.reedy, mark.dickinson, serhiy.storchaka, tehybel |
2016-08-26 19:21:04 | terry.reedy | set | messageid: <1472239264.87.0.889588596218.issue27867@psf.upfronthosting.co.za> |
2016-08-26 19:21:04 | terry.reedy | link | issue27867 messages |
2016-08-26 19:21:04 | terry.reedy | create | |
|