Summary
Remove AsyncIterators subclasses accross the lib to start using yield item.
What is the feature request for?
The core library
The Problem
Currently, the library has to mantain a bunch of custom AsyncIterator subclasses used for paginated endpoints, such as Messageable.pins, Guild.bans, etc.
The Ideal Solution
This should change to be typed as (typing or collections.abc).AsyncIterator[YieldType], be converted into async def functions, and simply yield the items.
This would also remove everything related to .flatten so it is better used as l = [i async for i in asynciterator].
An example from Guild.bans:
async def bans(self, params) -> AsyncIterator[Ban]:
# process stuff
for result in ...: # converted mapping of bans for example
yield result
The Current Solution
No response
Additional Context
No response
Summary
Remove
AsyncIterators subclasses accross the lib to start usingyield item.What is the feature request for?
The core library
The Problem
Currently, the library has to mantain a bunch of custom
AsyncIteratorsubclasses used for paginated endpoints, such asMessageable.pins,Guild.bans, etc.The Ideal Solution
This should change to be typed as
(typing or collections.abc).AsyncIterator[YieldType], be converted intoasync deffunctions, and simplyyieldthe items.This would also remove everything related to
.flattenso it is better used asl = [i async for i in asynciterator].An example from
Guild.bans:The Current Solution
No response
Additional Context
No response