Rename AsyncIterator.get to next to prevent shadowing.

This commit is contained in:
Rapptz
2017-07-04 10:45:38 -04:00
parent 94eb938d29
commit e0f02f1775
4 changed files with 26 additions and 13 deletions

View File

@ -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|