In the following example:
s = '1234567'
s[-2:-5] == ''
I am confused as to why the substring wouldn't be '654' and is instead the empty string.
You forgot to include the step parameter in the slice. It is 1 by default; therefore, by default, if start is greater than stop, the slice will be empty. Specify the step as -1:
s = '1234567'
print(s[-2:-5:-1])
# 654
In essence, it will start at index -2 at go backwards to index -5 instead of trying to go forward to index -5, which is impossible.