Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!newsfeed.straub-nv.de!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!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.015 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'context': 0.07; 'type,': 0.09; 'cc:addr:python-list': 0.11; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'generator.': 0.16; 'informal': 0.16; 'object;': 0.16; 'objects.': 0.16; 'subject:generator': 0.16; 'wrote:': 0.18; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'subject:/': 0.26; 'header:In-Reply-To:1': 0.27; 'function': 0.29; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; '13,': 0.31; 'question:': 0.31; 'fri,': 0.33; 'received:google.com': 0.35; 'should': 0.36; 'mar': 0.68; '2015': 0.84; 'whereas': 0.91; 'to:none': 0.92 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=Ie5JDyqEaWWiile497L1Q6WcO7FD9KjzcAksi+Au9bg=; b=fITPCEwp7N9c0OEE+uG3x4i5oHOmVUucyOdCSyOaRkXASxVCerTaj73nKhZjNg3tct ZUDU2gMVtdze0+zYuyfiHXQQIgc7hB2kGD96UpNJhZeb3fug272ax+27CXldVOvz7GnK 0J4f+/XtHV+12M6E1i3fjn5tJ0DrUDCIl/VqF6B1GhTKlmgmgPlAGwDlN/hZLfJ9BqB1 Xsw5bwyp5uDQR5GsKaz1V8A1q+2TYaFL/YXvJOFVl/qfMdvsFH+Kut2Nx9JYY3uxjs2t hIDGH+zqU1b2TL/qCqCGZW4dN51zYMNAhqcPrXvM24aV+MSlmKPUuNb38qy/SKs5fMQJ viVA== MIME-Version: 1.0 X-Received: by 10.107.16.31 with SMTP id y31mr8576340ioi.53.1426168555748; Thu, 12 Mar 2015 06:55:55 -0700 (PDT) In-Reply-To: References: Date: Fri, 13 Mar 2015 00:55:55 +1100 Subject: Re: generator/coroutine terminology 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.19 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: 14 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1426168558 news.xs4all.nl 2918 [2001:888:2000:d::a6]:47172 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:87320 On Fri, Mar 13, 2015 at 12:35 AM, Rustom Mody wrote: > If I look at type, g's type is 'generator' whereas foo is just plain-ol 'function.' > > Whereas in informal usage we say foo is a generator. > > So the question: > What should we call foo and what should we call g? g is a generator object; foo is a generator function - a function which returns generator objects. Usually, calling both of them "generators" isn't confusing, as there's not often any context in which they're ambiguous. ChrisA