Path: csiph.com!usenet.pasdenom.info!gegeweb.org!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed4.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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python.': 0.02; '16,': 0.03; 'from:addr:yahoo.co.uk': 0.04; 'output': 0.05; 'diff': 0.07; 'modify': 0.07; 'complicate': 0.09; 'function,': 0.09; 'lawrence': 0.09; 'mess': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'python': 0.11; 'def': 0.12; 'bug': 0.12; 'language.': 0.14; 'thread': 0.14; 'cleaned': 0.16; 'devs': 0.16; 'generator.': 0.16; 'here).': 0.16; 'iirc': 0.16; 'iterator': 0.16; 'next?': 0.16; 'ok...': 0.16; 'patches': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject:generator': 0.16; 'throw': 0.16; 'tomato': 0.16; 'do,': 0.16; 'language': 0.16; 'wrote:': 0.18; 'bit': 0.19; 'module': 0.19; '>>>': 0.22; 'accepted.': 0.22; 'header:User-Agent:1': 0.23; 'certainly': 0.24; 'lets': 0.24; 'source': 0.25; 'suggested': 0.26; 'tracker': 0.26; 'subject:/': 0.26; 'header:X-Complaints-To:1': 0.27; 'header:In- Reply-To:1': 0.27; 'function': 0.29; 'correct': 0.29; 'rest': 0.29; 'raise': 0.29; '>>>>': 0.31; 'doc': 0.31; 'inspect': 0.31; 'minor': 0.31; 'skip:= 20': 0.31; 'steven': 0.31; 'there.': 0.32; 'this.': 0.32; 'another': 0.32; 'text': 0.33; 'open': 0.33; 'up.': 0.33; 'community': 0.33; 'monday,': 0.33; 'plain': 0.33; 'third': 0.33; 'trouble': 0.34; 'core': 0.34; 'problem': 0.35; 'basic': 0.35; 'something': 0.35; 'etc': 0.35; 'but': 0.35; 'there': 0.35; 'yield': 0.36; 'shows': 0.36; 'somebody': 0.38; 'to:addr:python- list': 0.38; 'files': 0.38; 'issue': 0.38; 'expect': 0.39; 'does': 0.39; "couldn't": 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'called': 0.40; 'even': 0.60; 'areas': 0.61; 'march': 0.61; 'no.': 0.61; 'entire': 0.61; 'you.': 0.62; 'making': 0.63; 'our': 0.64; 'for:': 0.64; 'provide': 0.64; '(that': 0.65; 'kept': 0.65; 'here': 0.66; 'side': 0.67; 'dont': 0.67; 'believe': 0.68; 'yes': 0.68; 'past.': 0.68; '2015': 0.84; 'oscar': 0.84; 'gladly': 0.91; 'grey': 0.93; 'hills': 0.93 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Mark Lawrence Subject: Re: generator/coroutine terminology Date: Tue, 17 Mar 2015 03:07:07 +0000 References: <5501be8b$0$13006$c3e8da3$5496439d@news.astraweb.com> <874mpnp6nv.fsf@elektro.pacujo.net> <87y4mznmj8.fsf@elektro.pacujo.net> <55062bda$0$12998$c3e8da3$5496439d@news.astraweb.com> <87egopmn4z.fsf@elektro.pacujo.net> <55069623$0$12901$c3e8da3$5496439d@news.astraweb.com> <87vbi1qg0t.fsf@elektro.pacujo.net> <7cf04117-0fd5-40fb-bcaf-351353afc68b@googlegroups.com> <5506dd28$0$12975$c3e8da3$5496439d@news.astraweb.com> <6b2db06c-32b3-441d-b780-a16c4dfbf983@googlegroups.com> <6fbad705-a4a6-46fd-9344-1e9b473e89b0@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Gmane-NNTP-Posting-Host: host-92-24-223-15.ppp.as43234.net User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 In-Reply-To: <6fbad705-a4a6-46fd-9344-1e9b473e89b0@googlegroups.com> 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: 81 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1426561635 news.xs4all.nl 2874 [2001:888:2000:d::a6]:56951 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:87603 On 17/03/2015 02:52, Rustom Mody wrote: > On Monday, March 16, 2015 at 11:50:33 PM UTC+5:30, Mark Lawrence wrote: >> On 16/03/2015 14:37, Rustom Mody wrote: >>> On Monday, March 16, 2015 at 7:57:08 PM UTC+5:30, Mark Lawrence wrote: >>>> On 16/03/2015 14:19, Rustom Mody wrote: >>>>> ====================== >>>>> Anyways... >>>>> >>>>> Yes 15 years are past. >>>>> I dont expect the def can be revoked now. >>>>> [As far as I am concerned its a minor wart] >>>>> But the mess around the docs can certainly be cleaned up. >>>>> >>>> >>>> So write the patches to correct the docs, then raise the issue on the >>>> bug tracker to get the patches accepted. IIRC for doc patches you don't >>>> even have to provide diff files against the rst files, plain text will >>>> do, the core devs will do the rest for you. >>> >>> I would gladly do that if it was a minor correction here and there. >>> But the problem is a bit deeper even though it can be kept mostly¹ in the docs >>> and not modify any syntax/semantics of python. >>> >>> In particular for: >>> >>> def potato(x): >>> yield x+1 >>> >>> tomato = potato(3) >>> >>> what shall we call potato and tomato. >>> I believe this thread clearly shows that the docs are confused and inconsistent. >>> Yet I dont see any consensus on what/how to classify tomato/potato. >>> >>> Function -- trouble on one side >>> Generator -- trouble on another >>> Iterator -- trouble on third >>> etc >>> >>> ¹ Grey areas excepted eg output of help(); inspect module etc >>> >> >> So the docs are confused and inconsistent but in an open source >> community it's not *MY* responsibility to deal with it, somebody else can. >> >> Making mountains out of mole hills is all I see in this entire thread. > > Ok... Lets see... What if any agreement is there on this. > > To start with basic terminology. Given > >> def potato(x): >> yield x+1 >> >> tomato = potato(3) >> >> What shall we call potato and tomato? > > Steven suggested that potato can be called 'factory' > Not ideal, but way better than 'generator-function'. > Oscar does not like it. > No better/other suggestions (that we see here). > > What next? > > Ok Let me throw out a suggestion: > - potato is a generator > - tomato is a cursor. > Acceptable? > No. In Python potato is a generator function, tomato is a generator. Why complicate something that is so simple? I couldn't care less what they are called in any other language. -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence