Playing with string indexing/slicing, I'm seeing some (I think) non-intuitive behavior:
This prints:
I would instead have expected:
(1) A to print empty lines for all cases with the 2nd index <= -6?
(2) B to print empty lines for all cases with the 2nd index <= -2?
So, is this intentional?
Looked pretty wrong to me, too. See if topic/jsiwek/string-slicing-fix is better.
yeah, looks better, but I think it's now missing another piece: with the changed semantics for the end position, how does one get "everything until the end of the string"? Python has a[5:] for that.
how does one get "everything until the end of the string"? Python has a[5:] for that.
a[5:|a|] ? I.e. a[5:] is like a[5:len(a)] in Python. Probably wouldn't be hard to add the shorthand, I can take a look.
That's in the branch now.