Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardPythonawait schedulingSingle-choice MCQ

A custom object implements __await__ as a generator that does `v = yield "suspended"; return ("result", v)`. When this is driven manually with the iterator protocol, how is the final return value delivered?

class Awaitable: def __await__(self): v = yield "suspended" return ("result", v) aw = Awaitable().__await__() aw.send(None) # -> "suspended" aw.send("resumed") # -> ?