I\'m familiar with yield to return a value thanks mostly to this question
but what does yield do when it is on the right side of an assignment?
@cor
You can send values to the generator using the send function.
If you execute:
p = protocol()
p.next() # advance to the yield statement, otherwise I can't call send
p.send(5)
then yield will return 5, so inside the generator c will be 5.
Also, if you call p.next(), yield will return None.
You can find more information here.