Skip to content

Latest commit

 

History

History
13 lines (13 loc) · 282 Bytes

File metadata and controls

13 lines (13 loc) · 282 Bytes
>>> def coroutine():
...     print('coroutine started')
...     x = yield
...     print('coroutine received: {!r}'.format(x))
...
>>> coro = coroutine()
>>> next(coro)
coroutine started
>>> coro.send(42)
coroutine received: 42
Traceback (most recent call last):
  ...
StopIteration