[Python-Dev] Re: Discrepancy between what aiter() and `async for` requires on purpose?

2021-09-08 Thread Brett Cannon
On Wed, Sep 8, 2021 at 12:49 PM Yury Selivanov wrote: > We have already merged it, the fix is part of the rc2. > Thanks! (If we were on Discourse I would have left a ♥ instead ) > > yury > > > On Wed, Sep 8 2021 at 12:48 PM, Brett Cannon wrote: > >> On Thu, Sep 2, 2021 at 7:43 PM Yury

[Python-Dev] Re: Discrepancy between what aiter() and `async for` requires on purpose?

2021-09-08 Thread Yury Selivanov
We have already merged it, the fix is part of the rc2. yury On Wed, Sep 8 2021 at 12:48 PM, Brett Cannon wrote: > On Thu, Sep 2, 2021 at 7:43 PM Yury Selivanov > wrote: > >> Comments inlined: >> >> On Thu, Sep 2, 2021 at 6:23 PM Guido van Rossum wrote: >> >>> First of all, we should ping

[Python-Dev] Re: Discrepancy between what aiter() and `async for` requires on purpose?

2021-09-08 Thread Brett Cannon
On Thu, Sep 2, 2021 at 7:43 PM Yury Selivanov wrote: > Comments inlined: > > On Thu, Sep 2, 2021 at 6:23 PM Guido van Rossum wrote: > >> First of all, we should ping Yury, who implemented `async for` about 6 >> years ago (see PEP 492), and Joshua Bronson, who implemented aiter() and >> anext()

[Python-Dev] Re: Discrepancy between what aiter() and `async for` requires on purpose?

2021-09-03 Thread Dennis Sweeney
I think the C implementation of PyAiter_Check was a translation of the Python code `isinstance(..., collections.abc.AsyncIterator)`, but I agree that it would be more consistent to just check for __anext__. There were comments at the time here:

[Python-Dev] Re: Discrepancy between what aiter() and `async for` requires on purpose?

2021-09-02 Thread Yury Selivanov
Comments inlined: On Thu, Sep 2, 2021 at 6:23 PM Guido van Rossum wrote: > First of all, we should ping Yury, who implemented `async for` about 6 > years ago (see PEP 492), and Joshua Bronson, who implemented aiter() and > anext() about 5 months ago (see https://bugs.python.org/issue31861).

[Python-Dev] Re: Discrepancy between what aiter() and `async for` requires on purpose?

2021-09-02 Thread Guido van Rossum
First of all, we should ping Yury, who implemented `async for` about 6 years ago (see PEP 492), and Joshua Bronson, who implemented aiter() and anext() about 5 months ago (see https://bugs.python.org/issue31861). I've CC'ed them here. My own view: A. iter() doesn't check that the thing returned

[Python-Dev] Re: Discrepancy between what aiter() and `async for` requires on purpose?

2021-09-01 Thread Nick Coghlan
On Tue, 31 Aug 2021, 2:52 am Brett Cannon, wrote: > > On Sun, Aug 29, 2021 at 2:01 PM Serhiy Storchaka > wrote: > >> >> > So my question is whether the discrepancy between what `async for` >> > expects and what `aiter()` expects on purpose? >> > https://bugs.python.org/issue31861

[Python-Dev] Re: Discrepancy between what aiter() and `async for` requires on purpose?

2021-08-30 Thread Brett Cannon
On Sun, Aug 29, 2021 at 2:01 PM Serhiy Storchaka wrote: > 29.08.21 23:16, Brett Cannon пише: > > If you look at > > > https://github.com/python/cpython/blob/b11a951f16f0603d98de24fee5c023df83ea552c/Python/ceval.c#L2409-L2451 > > < >

[Python-Dev] Re: Discrepancy between what aiter() and `async for` requires on purpose?

2021-08-29 Thread Serhiy Storchaka
29.08.21 23:16, Brett Cannon пише: > If you look at > https://github.com/python/cpython/blob/b11a951f16f0603d98de24fee5c023df83ea552c/Python/ceval.c#L2409-L2451 > > you will see that `async