After reading the docs and thinking a while, I come to the following result:
a.send(100) does not send x but the yield expression
Python must do so, otherwise it had problems handling send() for a generator gen(x,y):
What would you send in this case if send has exactly 1 argument.
As a model u can regard yield x as a variable that is created with first yield and can be manipulated with send()
So, send() does the same as next()?
P.S. If you run my code now, you will see a very interesting thing in the second example with double “yield”! It looks like these two “yields” work one after another: with first “next()” it prints out the first element of generator (so I guess the inner “yield x” does this), but with second “next()” it prints out “None” (as if outer “yield” is doing this). And if I write “send(value)” instead of the second “next()”, it prints out the “value” of “send”!