From e0f02f1775b2a239f626edf4cbab079c2319db3d Mon Sep 17 00:00:00 2001 From: Rapptz Date: Tue, 4 Jul 2017 10:45:38 -0400 Subject: Rename AsyncIterator.get to next to prevent shadowing. --- docs/api.rst | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'docs') 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| -- cgit v1.2.3