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


Groups > comp.lang.python > #102279

Cannot step through asynchronous iterator manually

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From "Frank Millman" <frank@chagford.com>
Newsgroups comp.lang.python
Subject Cannot step through asynchronous iterator manually
Date Sat, 30 Jan 2016 08:03:04 +0200
Lines 17
Message-ID <mailman.113.1454133801.2338.python-list@python.org> (permalink)
Mime-Version 1.0
Content-Type text/plain; format=flowed; charset="iso-8859-1"; reply-type=original
Content-Transfer-Encoding 7bit
X-Trace news.uni-berlin.de a0siL6vUiXvMg6kTRs/WVQgjwC22hT/mv2lFCD7NucFw==
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.007
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'higher-level': 0.09; 'loop.': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'python': 0.10; 'iterator': 0.16; 'received:80.91.229.3': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'header:X-Complaints-To:1': 0.26; "skip:' 10": 0.28; 'usually': 0.33; 'expected': 0.35; 'step': 0.36; 'but': 0.36; 'to:addr :python-list': 0.36; 'received:org': 0.37; 'desired': 0.37; 'missing': 0.37; 'to:addr:python.org': 0.40; 'frank': 0.72; "'for'": 0.84; 'construct': 0.84
X-Injected-Via-Gmane http://gmane.org/
X-Gmane-NNTP-Posting-Host 197.86.205.12
X-MSMail-Priority Normal
Importance Normal
X-Newsreader Microsoft Windows Live Mail 15.4.3502.922
X-MimeOLE Produced By Microsoft MimeOLE V15.4.3502.922
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.20+
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Xref csiph.com comp.lang.python:102279

Show key headers only | View raw


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?

Frank Millman

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


Thread

Cannot step through asynchronous iterator manually "Frank Millman" <frank@chagford.com> - 2016-01-30 08:03 +0200

csiph-web