The documentation is not very informative (at least for me):
opcode:: RESUME (context)
A no-op. Performs internal tracing, debugging and optimization checks.
The
contextoparand consists of two parts. The lowest two bits indicate where theRESUMEoccurs:
0The start of a function, which is neither a generator, coroutine nor an async generator
1After ayieldexpression
2After ayield fromexpression
3After anawaitexpressionThe next bit is
1if the RESUME is at except-depth1, and0otherwise.
Example:
>>> import dis
>>>
>>> def f(): ...
...
>>> dis.dis(f)
1 0 RESUME 0
2 LOAD_CONST 0 (None)
4 RETURN_VALUE
Can someone provide an explanation of what this opcode really does?