Split it into two steps.
First
print ['a', 'b'][0 == 1]
# 'a'
print ['a', 'b'][0 == 0]
# 'b'
In python, if you use a boolean value as array index, False is considered as 0, and True as 1. So in your case, the value of
[
(item['path'], prev_item['path']),
(prev_item['path'], item['path']),
][item['op'] == 'add']
should be (item['path'], prev_item['path']) if item['op'] is not "add" otherwise (prev_item['path'], item['path']).
Then the assignment
a, b = (0, 1)
is very similar to a = 0, b = 1. In your case, if item['op'] equals to "add", the result is
move_from = prev_item['path']
move_to = item['path']
Although it is completely valid to use a boolean value, I don't suggest program like that. A more common convention is to use CONSEQUENCE if PREDICATE else ALTERNATIVE (like PREDICATE ? CONSEQUENCE : ALTERNATIVE in C-like language)
move_from, move_to = (prev_item['path'], item['path']) \
if item['op'] == 'add' else \
(item['path'], prev_item['path'])
Since there's no tuple assignment in JS, I think a simple way is
if (item['op'] === 'add') {
move_from = prev_item['path'];
move_to = item['path'];
} else {
move_from = item['path'];
move_to = prev_item['path'];
}