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>That's valid syntax, so you didn't get a SyntaxError. It's just not a meaningful or supported operation on Python lists. Similarly, <code>"5" + fish</code> isn't a SyntaxError, <code>1/0</code> isn't a SyntaxError, and <code>I.am.a.monkey</code> isn't a SyntaxError.</p>

<p>You can't just expect all syntactically valid expressions to be meaningful.</p>

python python-3.x slice