The colon syntax is syntactical sugar for a slice(..) object. Your expression is equvalent to:
# v slice object
print(c[(slice(None), 1)])
# ^ tuple ^
So you have passed a tuple containing a slice(None) object as first element, and 1 as second element.
The mapping of slice syntax to slice(..) objects is as follows:
- the colon
: is equivalent to slice(None);
- if it is
:b, then it is equivalent to slice(b);
a: is equivalent to slice(a, None);
a:b is equivalent to slice(a, b);
::c is equivalent to slice(None, None, c);
:b:c to slice(None, b, c);
a::c is equivalent to slice(a, None, c); and
a:b:c to slice(a, b, c).
Note that slice syntax is only supported in the context of an itemgetter (so x[..]).
print(c[EMPTY:EMPTY,1])is better understood.