title: Find start and end indices using slices.index for missing start and end values?
body: <p>I was trying to find range and steps that would be applied while slicing a list in python. An easy way to do it is if we know the start and end index and steps provided then we can use slices.index method to do so. For e.g Creating a slice object and using indices method on top of it returns me a tuple with start, stop and step values.</p>
  <pre><code>  slice(start,stop,step).indices(length of index) -&gt; ( start, end, step) 
    &gt;&gt;&gt; slice(10,-5,-1).indices(6)
       (5, 1, -1)
    &gt;&gt;&gt;
  </code></pre>
  <p>There are cases where these start and end indexes in above e.g 10 and 5 passed to create object slice are missing, so for such scenarios what would be the appropriate replacement for these values while creating slice object ?</p>
  <pre><code>   &gt;&gt;&gt; seq='python'
     &gt;&gt;&gt; seq[::-1]
  </code></pre>
  <p>Note i understand there are rules around how to calculate i and j when the steps are positive or negative. E.g</p>
  <p><code>If i and j is omitted and step is &gt; 0 then i is 0 and j is len(seq) while if step is -1 then i is len(seq)-1 and j  is -1</code></p>
  <p>As per this rule in below e.g i=5 and j=-1. Ideally -1 is end index ( not sure if rules gets changed when steps are positive vs negative ) so this should have not reversed the string.I tried to substitute this with the hardcode values and it results me and empty sequence which is exactly what i expected.</p>
  <pre><code> &gt;&gt;&gt; seq='python'
   &gt;&gt;&gt; seq[::-1]
      'nohtyp'
  
  
   &gt;&gt;&gt; seq[5:-1:-1]
       ''
  </code></pre>
  <p>So how does this reverse string works, I wanted to check if i can used slice.index method to get the values but I am not sure how to substitute start and end while creating a slice object for missing i and j.</p>
  <p>Thanks</p>