I find a strange statement when I’m reading PIL document.
In 1.1.6 and later, load returns a pixel access object that can be
used to read and modify pixels. The access object behaves like a
2-dimensional array, so you can do:pix = im.load() print pix[x, y] pix[x, y] = value
What does pix[x, y] mean here? It’s not slicing syntax because , used rather than :.
is the same as
or
or
What you’re seeing is a tuple literal inside an item-getting expression, in the same way that I can nest other expressions such as
l[1 if skip else 0]