Message381516
What you are or should be asking for is an alternate string representation method, perhaps called 'colon', so that for instance
myslice.colon() == '::2'
The function could take an optional length (as with .indices, but optional) to produce the same numbers as .indices.
myslice.colon(8) == '0:8:2'
slice(0, -1, 3).colon(14) == '0:13:3'
I suspect that something like this has been asked before. I suggest you post to python-ideas list to see if there is any support and any better idea for the name. |
|
Date |
User |
Action |
Args |
2020-11-21 01:37:45 | terry.reedy | set | recipients:
+ terry.reedy, rossbar |
2020-11-21 01:37:45 | terry.reedy | set | messageid: <1605922665.69.0.291665032783.issue42352@roundup.psfhosted.org> |
2020-11-21 01:37:45 | terry.reedy | link | issue42352 messages |
2020-11-21 01:37:45 | terry.reedy | create | |
|