Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed2a.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.014 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'syntax': 0.04; 'bash': 0.09; 'forms,': 0.09; 'scripting': 0.09; 'cc:addr:python-list': 0.11; 'finicky': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'newlines': 0.16; 'sign.': 0.16; 'syntax,': 0.16; 'wrote:': 0.18; 'cc:addr:python.org': 0.22; '(by': 0.24; 'instead.': 0.24; 'versions': 0.24; 'looks': 0.24; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'newer': 0.30; 'message- id:@mail.gmail.com': 0.30; 'that.': 0.31; "d'aprano": 0.31; 'steven': 0.31; 'languages': 0.32; 'older': 0.33; 'maybe': 0.34; 'common': 0.35; 'something': 0.35; 'case,': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'really': 0.36; 'e.g.': 0.38; 'pm,': 0.38; 'believe': 0.68; 'dollar': 0.74; 'lack': 0.78; '2015': 0.84; 'canonical': 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=EDVrvdGQLjOKD+D6k1lGVc+eNzwZNzLK1k0TZjBR4mY=; b=UU+/DnNG8Hit4Gb47iLlonkXiXUp2KI9vgBkXKnYQsOOvYsZpG18QO09+rQ+jaoC1E EiiqXi4QEgn24F2DX/KjdsxY7fgIGoez+7uEMM1RjI4FWE8y10D25C8aCJqwRgo+lv2o n8PsrWunyMkXyVoDZnxwWoKSPQpUfCo619IM9V3p4AydqgtsydiCOuBxirs+Nmr3+oGm 6G9sBeiPaKNeofJpF4y++zfsxSjIqMaUxfRNARmmC0oIZEoYap/5OAzxXKOPfq45qk8D r97mhghWTl7KPzI9qB+KO/1Mcoql8E2yUtRT3qRbqf1fvWrNiscjyrHmUeKn7MW7PXOL 0oNA== MIME-Version: 1.0 X-Received: by 10.43.17.135 with SMTP id qc7mr22630711icb.59.1430650794473; Sun, 03 May 2015 03:59:54 -0700 (PDT) In-Reply-To: <5545f930$0$12976$c3e8da3$5496439d@news.astraweb.com> References: <87k2wtvbx1.fsf@Equus.decebal.nl> <_M61x.477467$Ek.357048@fx07.am4> <5545f930$0$12976$c3e8da3$5496439d@news.astraweb.com> Date: Sun, 3 May 2015 20:59:54 +1000 Subject: Re: l = range(int(1E9)) 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.20+ 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: 18 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1430650797 news.xs4all.nl 2931 [2001:888:2000:d::a6]:56909 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:89856 On Sun, May 3, 2015 at 8:32 PM, Steven D'Aprano wrote: > scripting > languages often lack a C-style for-loop, using a foreach loop instead. E.g. > I believe the canonical way to loop in bash is something like: > > for $i in `seq start stop` do ... > > (by memory). Newer versions of bash have grown an alternative syntax for that common case, but if you need to support older forms, or other shells, then yes, it's something like that. Maybe without the dollar sign. (I can never remember the exact syntax, and I know bash is really finicky about where you put newlines and where you don't, but it looks something like what you had.) ChrisA