I am trying to rewrite a piece of C code from another author into Python, and I came across the following type of notation:
x = y[a=b];
where y
is an array and a
and b
are integers. At first I thought it meant something like this:
a = b;
x = y[a];
But apparently it doesn't. Can anyone tell me what this expression means? Forgive me if this question is a duplicate, but it is very hard to summarise this question in a couple of searchable keywords, and I could not find anything that answers my question.
The source of the code I am trying to rewrite: link
EDIT:
The Python-rewritten code does not work as it should (stuck in a loop), so I thought that I misinterpreted the above statement. But as several of you have suggested, it was correct in the first place. I must be something else then...