Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.058 X-Spam-Evidence: '*H*': 0.89; '*S*': 0.00; 'yeah,': 0.09; 'cc:addr :python-list': 0.11; 'python': 0.11; '*any*': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'generator.': 0.16; 'preserves': 0.16; 'wrote:': 0.18; "hasn't": 0.19; 'cc:addr:python.org': 0.22; 'mon,': 0.24; 'cc:2**0': 0.24; 'values': 0.27; 'header:In-Reply-To:1': 0.27; 'function': 0.29; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; '(which': 0.31; 'framework': 0.33; 'something': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'similar': 0.36; 'list.': 0.37; 'list,': 0.38; 'called': 0.40; 'temporarily': 0.60; 'more': 0.64; 'jul': 0.74; 'otten': 0.84; 'suspicion': 0.84; 'to:none': 0.92; 'state.': 0.95 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=I3UVrYvt7B+aY6WOeDFsYsumkcU4uTO6Y1ZvutOSV10=; b=0TLPltvl+x7bo7Oe+1ocg87mUNbw1CQVMwAUiLbsgiZMGbDlsRnZZF7wSbbOr0ExOp uujRuQ1GVhRpPUk4+juOY7Ar65uM9CvjNPTGXwWc4nLoVS/UiGTDJbBQQp3mET+apDyJ XoronZrz/CCbDj4h/ZY5r5KuaYQJDF55Yqqpi48krBq+tAW/v4QwPhB32Q7Ee6XMw/+x dGJEEqtm/kdGr9k4ux9k1mOefOw1uV8rm4j5kupElLVYHKqHDGob9E090rqxVQaMQ+I0 LW4dvr/NemeDPxQWrt8c8Aj8qEezSJHseChgWZ7VgqfKlf1aQ+/k0sJ2qPcp/Q1A2oiv xnxA== MIME-Version: 1.0 X-Received: by 10.43.96.65 with SMTP id cf1mr5976432icc.26.1406484647901; Sun, 27 Jul 2014 11:10:47 -0700 (PDT) In-Reply-To: References: Date: Mon, 28 Jul 2014 04:10:47 +1000 Subject: Re: complete brain fart, it doesn't loop From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 10 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1406484657 news.xs4all.nl 2948 [2001:888:2000:d::a6]:33712 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:75278 On Mon, Jul 28, 2014 at 4:07 AM, Peter Otten <__peter__@web.de> wrote: > By the way, Python has something similar to a function that temporarily > interrupts execution but preserves state. It's called generator. Yeah, but I have a suspicion his web framework (which he hasn't identified, but I suspect *any* web framework) won't be looking for a generator :) More likely, what he wants is to collect up the return values in a list, and then return ''.join() that list. ChrisA