Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: "Frank Millman" Newsgroups: comp.lang.python Subject: Cannot step through asynchronous iterator manually Date: Sat, 30 Jan 2016 08:03:04 +0200 Lines: 17 Message-ID: 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: 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:102279 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