[Python-ideas] async/await in Python

Yury Selivanov yselivanov.ml at gmail.com
Sat Apr 18 01:26:43 CEST 2015


On 2015-04-17 7:08 PM, Chris Angelico wrote:
> On Sat, Apr 18, 2015 at 8:56 AM, Yury Selivanov <yselivanov.ml at gmail.com> wrote:
>> You forget that '__anext__' can be implemented as 'async def'
>> function, as well as a regular 'def' returning an *awaitable*
>> object, such as asyncio.Future or generator wrapped in
>> 'types.async_def'.
> Oh. Hrm. Good point.
>
> There is still the concern that StopAsyncIteration bubbling will be
> just as much a problem as StopIteration bubbling is, but you're in a
> better position than I am to look into that.

I couldn't come up with an example where StopAsyncIteration
would have same "bubbling" problems as StopIteration (I tried
to).

If someone can come up with a good case that would definitely
trigger more thinking about that.  FWIW, there is a PEP
implementation, so it's possible to explore and prototype.

Best,
Yury


More information about the Python-ideas mailing list