Understanding python slicings syntax as described in the python language reference
<p>The following is the slicings syntax that I copied from <a href="https://docs.python.org/3/reference/expressions.html#slicings" rel="nofollow">The Python Language Reference</a>:</p>

<pre><code>slicing      ::=  primary "[" slice_list "]"
slice_list   ::=  slice_item ("," slice_item)* [","]
slice_item   ::=  expression | proper_slice
proper_slice ::=  [lower_bound] ":" [upper_bound] [ ":" [stride] ]
lower_bound  ::=  expression
upper_bound  ::=  expression
stride       ::=  expression
</code></pre>

<p>Per my understanding, this syntax equates to <code>SomeMappingObj[slice_item,slice_item etc...]</code> which again equates to something like <code>a[0:2:1,4:7:1]</code> and <code>a =[i for i in range(20)]</code>. </p>

<p>But, I can't test this in IPython and I did not find any questions about multiple slicings. Is my interpretation about multiple slicing in python correct? What am I doing incorrectly?</p>

<pre><code>In [442]: a=[i for i in range(20)]

In [443]: a[0:12:2]
Out[443]: [0, 2, 4, 6, 8, 10]

In [444]: a[0:12:2,14:17:1]
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
&lt;ipython-input-444-117395d33bfd&gt; in &lt;module&gt;()
----&gt; 1 a[0:12:2,14:17:1]

TypeError: list indices must be integers or slices, not tuple
</code></pre>

<p>This isn't a syntax issue hence no <code>SyntaxError</code>, <em>this syntax is totally supported</em>. <code>list</code>'s just don't know what to do with your slices. Take for example a dummy class that does <em>nothing</em> but define <code>__getitem__</code> that receives the contents of subscriptions <code>[]</code>:</p>

<pre><code>class DummySub:
    def __getitem__(self, arg):
        print(arg)

f = DummySub()
</code></pre>

<p>It just prints its <code>arg</code>. We can supply slices, as permitted by the grammar, but, <em>it's up to the implementing object to decide if these are an operation</em> that's supported and act on them (like <code>nparray</code>s do) or not (and raise a <code>TypeError</code>):</p>

<pre><code>f[1:2:3, 4:4:4]
(slice(1, 2, 3), slice(4, 4, 4))
</code></pre>

<p>Heck:</p>

<pre><code>f[1:2:3, 4:5:6, 7:8:9, ...]  # totally valid
(slice(1, 2, 3), slice(4, 5, 6), slice(7, 8, 9), Ellipsis)
</code></pre>

<p>By reading further on in the <a href="https://docs.python.org/3/reference/expressions.html#slicings" rel="nofollow"><em>reference for slicings</em></a> you should see that:</p>

<blockquote>
  <p>The semantics for a slicing are as follows. The primary is indexed (using the same <code>__getitem__()</code> method as normal subscription) with a key that is constructed from the slice list, as follows. <em>If the slice list contains at least one comma, the key is a tuple containing the conversion of the slice items</em>; otherwise, the conversion of the lone slice item is the key. </p>
</blockquote>

<p><sup><em>(emphasis mine)</em></sup></p>

python python-3.x slice