Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Chris Angelico Newsgroups: comp.lang.python Subject: Re: How the heck does async/await work in Python 3.5 Date: Sat, 20 Feb 2016 18:57:23 +1100 Lines: 13 Message-ID: References: <56c7d145$0$1597$c3e8da3$5496439d@news.astraweb.com> <9d968a2e-f23c-4c93-979d-43dfa610c343@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de V5DwkTgscezEdaVYCDg9xANHj5L0F/Zp2NJfC6yigQyg== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'received:209.85.223': 0.03; 'subject:Python': 0.05; 'exception.': 0.07; 'cc:addr:python- list': 0.09; 'subject:How': 0.09; '__future__': 0.09; 'none.': 0.09; 'propagate': 0.09; 'exception': 0.13; '2016': 0.16; 'cc:name:python': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'received:209.85.223.173': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'wrote:': 0.16; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'feb': 0.23; 'sat,': 0.23; 'import': 0.24; 'header:In-Reply-To:1': 0.24; 'equivalent': 0.27; 'separate': 0.27; 'question': 0.27; 'message-id:@mail.gmail.com': 0.27; 'mind,': 0.29; 'pep': 0.29; 'subject:/': 0.30; 'supposed': 0.31; 'another': 0.32; 'generally': 0.32; 'point': 0.33; 'raising': 0.33; 'gets': 0.35; 'received:google.com': 0.35; 'fresh': 0.35; 'returning': 0.35; 'but': 0.36; 'should': 0.36; 'received:209.85': 0.36; 'subject:work': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'received:209': 0.38; 'subject:the': 0.39; 'future': 0.60; 'save': 0.60; '20,': 0.66; 'yourself': 0.73; 'chrisa': 0.84; 'discussion)': 0.84; 'to:none': 0.91; 'awaiting': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=Nt1k0G7FhDiuqKIi/tjhZ0eI0kwm+ttiboILct2WfHs=; b=wO3bHnp2n5cG2MDWge4pMUe9bRabV3DOJK34ZfZ+bSxm2nIjuZpMBDjSqA/LkZz9u1 J6MqqWvbta81pybwziWIAoMXb8CbmmORnB+xlh+yMtAZyUqTYu6Pq20aeVEMLYUf4SHk zLtBEzvEmj3X6+tlQn9jN3gH0ZFUQw1eYvpNaq+EF51pJXToH8Cy3FujfmHG7bJNHYIf CQxWqAixQrMGYjqi9ca1p2ktgGijNlgvC5ZWZ6gS7YgOVCjbuvPC3i0SfpLx6ai+otbF QemFInbIFMXnvPKvVp6VMkKIsPK5AagliLZ9KR3YhP+O0ApmN+GlftwVTqizuhQircSZ /rOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:cc:content-type; bh=Nt1k0G7FhDiuqKIi/tjhZ0eI0kwm+ttiboILct2WfHs=; b=nI06FDqrHg80mQzRKKfh4uAnLjAcKwLoYNPUNbYnWP/IuB7Y7zqEzpti5PUmrrF6vY bbwzK5x6ShkZR2kYRAB0t8gImRdN2ql8+uXHGnjwDGVcysCXCJv2tEAOB09x1IYh2wcc CrdVxe74MGjymKJB3YY9ZrVp8OO/zXIoCq6xc5OLKjFrDcLPs8sLwhRREig1PXhJmJ+w Rb3zgRMEk5OxKjh7QGqzZOXAhJDCDHzGIpIhCl8YySXEkWJy1ubySd6R8+Ny2+fDOHCi GaaNzbqx2NsubFRNY3y6ot6+rTxVWDdCUokb/wpmKc6k1PBmgvdqiBW5kYWhYZmVbGGx gr2A== X-Gm-Message-State: AG10YOQZif6u+we+BhTR0uiJjnDAqn5ttE/uAfEDT26mR9cggNxLkYOLiUmQmxd+0eA/l+eLG3ApCVletJCMkg== X-Received: by 10.107.47.162 with SMTP id v34mr17034940iov.19.1455955043676; Fri, 19 Feb 2016 23:57:23 -0800 (PST) In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.21rc2 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:103246 On Sat, Feb 20, 2016 at 6:48 PM, Ian Kelly wrote: > As another point that happens to be fresh in my mind, awaiting a > Future on which an exception gets set is supposed to propagate the > exception. I recently found that this breaks if the exception in > question happens to be StopIteration (granted not one that should > generally be allowed to propagate anyway, but that's a separate > discussion) for the simple reason that raising StopIteration in a > generator is equivalent to returning None. Solved by PEP 479. Use "from __future__ import generator_stop" to save yourself the pain. ChrisA