Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #102284

Re: Cannot step through asynchronous iterator manually

From Ian Kelly <ian.g.kelly@gmail.com>
Newsgroups comp.lang.python
Subject Re: Cannot step through asynchronous iterator manually
Date 2016-01-30 01:02 -0700
Message-ID <mailman.114.1454140952.2338.python-list@python.org> (permalink)
References <n8hjmt$b8n$1@ger.gmane.org>

Show all headers | View raw


On Jan 29, 2016 11:04 PM, "Frank Millman" <frank@chagford.com> wrote:
>
> Hi all
>
> To loop though an iterator one usually uses a higher-level construct such
as a 'for' loop. However, if you want to step through it manually you can
do so with next(iter).
>
> I expected the same functionality with the new 'asynchronous iterator' in
Python 3.5, but I cannot find it.
>
> I can achieve the desired result by calling 'await aiter.__anext__()',
but this is clunky.
>
> Am I missing something?

async for x in aiter:
    pass

Can only be used inside a coroutine, of course.

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Cannot step through asynchronous iterator manually Ian Kelly <ian.g.kelly@gmail.com> - 2016-01-30 01:02 -0700

csiph-web