Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Ian Kelly Newsgroups: comp.lang.python Subject: Re: How the heck does async/await work in Python 3.5 Date: Sat, 20 Feb 2016 02:11:33 -0700 Lines: 9 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 OXM5UPJkBt48IgtJF97QiQdWE5IAGIJxHNSuaPGX3dEg== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'subject:Python': 0.05; 'raises': 0.07; 'subject:How': 0.09; '__future__': 0.09; 'fixed,': 0.09; '2016': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'runtimeerror': 0.16; 'wrote:': 0.16; 'case.': 0.18; 'odd': 0.18; 'am,': 0.23; 'seems': 0.23; 'feb': 0.23; 'sat,': 0.23; 'import': 0.24; 'header:In-Reply-To:1': 0.24; "doesn't": 0.26; '(which': 0.26; 'chris': 0.26; 'message-id:@mail.gmail.com': 0.27; 'behaviour': 0.29; 'raise': 0.29; 'subject:/': 0.30; 'received:google.com': 0.35; 'should': 0.36; 'needed': 0.36; 'received:209.85': 0.36; 'subject:work': 0.36; 'to:addr:python- list': 0.36; 'subject:: ': 0.37; 'received:209.85.213': 0.37; 'seem': 0.37; 'itself': 0.38; 'received:209': 0.38; 'why': 0.39; 'subject:the': 0.39; 'to:addr:python.org': 0.40; '20,': 0.66; 'await': 0.76; 'to:name:python': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=TSeooSNVKnHandGudn8VKRGtUNVhiff5zAsxB7bQkrc=; b=rpxx5BYS+PCFKbcPslA6REHaekoa4CLevg/hiVX3nZn7lidjweQ2pen3ogeYm/Q3bX N4XusG6vX10z6G0j2cWclIEvh1ItNXhRxexEb++peIKu8RQj8wJ51xU41NzutREq53i/ GwEPuZrx9gD/7hTRJTukivQ2pFS7uT9dlEjqjjy8g6ifFVxPqpI4RwBTxRQr4OTuUkZd TmEc8WlJ5kSxdkHEDK6XD5ewVRN3lHZ2Sc46h9lk+HoAd3AbIe6EkDK0KqhQ32itcMcC FyQqQFVU8yUctOX6tG2J2FUdwzvl2hI9wmG/87ZYqGjOp15oRrfUoDGY2jvra+H7f9Cu HiEA== 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:from:date :message-id:subject:to:content-type; bh=TSeooSNVKnHandGudn8VKRGtUNVhiff5zAsxB7bQkrc=; b=B1tQt2E/S0T1VCpxctFMxogw3u6ntrl2FEeOLOBtgtwGEv3EMMfWXt5ZdBXTwVi7X6 nisHOiva2INgJpRt1qNAx+2uRnNg79f10d0iX+Ym7QoeSkCmGbCp+QfKxNjUpVnwuRke 90q7FRwdqZ5yilJQxgbgb9vuGfyn2Nv5XK7uZkg1kTeyRXaOpkjICEC8qCZ5MdACaKjW TG4YStjnsMP+aFk5jUVFoJG6pHxjC+LsZuwdEWQYHunLws1VNz5LG2Qz5Ux0eEMkzI0K EJAi6m5w4U7xrmZ74sN+f/d3l2onO6XYugWYbe7/1CVMkiuGtreY053ncmSPum1JU8ad KUpw== X-Gm-Message-State: AG10YOQFWUyxAy8AxtOXkUsgupqn55Cg0dmENQuxK+MjXCSQdq31q2FUEsOk/yE+gvbtZs3m0nTL1ECnEAfdZw== X-Received: by 10.50.85.105 with SMTP id g9mr1332209igz.85.1455959533166; Sat, 20 Feb 2016 01:12:13 -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:103259 On Sat, Feb 20, 2016 at 1:49 AM, Chris Angelico wrote: > Definitely seems like it should be fixed, then; the current behaviour > is that Future.result() raises RuntimeError if you raise > StopIteration, so having await do the same would make sense. Future.result() itself simply raises the StopIteration. If you call it inside a coroutine (which seems odd -- why not await it?) then it's the coroutine that reraises the StopIteration as RuntimeError. The __future__ import doesn't even seem to be needed in this case.