This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # First, let's create an awaitable object. | |
| # In this case it's a very dumb container of integers. | |
| # Any time a coroutine runs `await Thing(n)` it just resolves to n | |
| # However, we could resolve it to something completely different if we wanted to | |
| class Thing: | |
| def __init__(self, n): | |
| self._n = n | |
| def __await__(self): |