Как работает этот код, включая назначение и оператор yield? Результаты довольно сбивают.
def test1(x): 
    for i in x:
        _ = yield i 
        yield _
def test2(x): 
    for i in x:
        _ = yield i 
r1 = test1([1,2,3])
r2 = test2([1,2,3])
print list(r1)
print list(r2)
Вывод:
[1, None, 2, None, 3, None] 
[1, 2, 3]