On Sat, Mar 20, 2021 at 7:49 PM Chris Angelico <rosuav@gmail.com> wrote:
That said I wouldn't mind aiter() supporting the two-arguments mode as it could make it easier to convert some sync code bases (that use greenlets, for example) to async. And given that async iteration mirrors
On Sun, Mar 21, 2021 at 1:30 PM Yury Selivanov <yselivanov.ml@gmail.com> wrote: the sync iteration protocol pretty closely, I think that aiter() fully mirroring iter() is expected. I do realize that my arguments here are weak, so my vote is +0 to support the two-arguments mode.
I'm -0.5 on two-argument aiter(), mainly because YAGNI. Two-arg iter() might be worth a single bullet point somewhere in a list of "translating blocking code to nonblocking".
It was made of one use case: iter(f.readline, ""). -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun here?)* <http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-c...>