Advanced Python
Q100 / 101

What is a Python coroutine protocol (PEP 342)?

Correct! Well done.

Incorrect.

The correct answer is B) Enhanced generators with send(), throw(), and close() methods enabling two-way communication and forming the basis of Python's coroutine mechanism

B

Correct Answer

Enhanced generators with send(), throw(), and close() methods enabling two-way communication and forming the basis of Python's coroutine mechanism

Explanation

PEP 342 added send(value) and throw(exc) to generators. This enabled coroutine-like behavior before async/await. PEP 492 (Python 3.5) formalized native coroutines (async def).

Progress
100/101