diff options
| author | Rapptz <[email protected]> | 2017-07-04 10:45:38 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2017-07-04 10:45:38 -0400 |
| commit | e0f02f1775b2a239f626edf4cbab079c2319db3d (patch) | |
| tree | 33b1be431b0789a105aa6209255c7cf1de208eff /docs | |
| parent | handle Game.name being None (diff) | |
| download | discord.py-e0f02f1775b2a239f626edf4cbab079c2319db3d.tar.xz discord.py-e0f02f1775b2a239f626edf4cbab079c2319db3d.zip | |
Rename AsyncIterator.get to next to prevent shadowing.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/api.rst | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/docs/api.rst b/docs/api.rst index bdddb654..f06b26c4 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -1246,7 +1246,7 @@ If you are using 3.4 however, you will have to use the more verbose way: :: iterator = channel.history() # or whatever returns an async iterator while True: try: - item = yield from iterator.get() + item = yield from iterator.next() except discord.NoMoreItems: break @@ -1259,6 +1259,19 @@ Certain utilities make working with async iterators easier, detailed below. Represents the "AsyncIterator" concept. Note that no such class exists, it is purely abstract. + .. container:: operations + + .. describe:: async for x in y + + Iterates over the contents of the async iterator. Note + that this is only available in Python 3.5 or higher. + + + .. method:: next() + + Advances the iterator by one, if possible. If no more items are found + then this raises :exc:`NoMoreItems`. + .. method:: get(**attrs) |coro| |