what does yield as assignment do? myVar = (yield)

The yield statement used in a function turns that function into a “generator” (a function that creates an iterator). The resulting iterator is normally resumed by calling next(). However it is possible to send values to the function by calling the method send() instead of next() to resume it:

cr.send(1)

In your example this would assign the value 1 to c each time.

cr.next() is effectively equivalent to cr.send(None)

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)