Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.stack.nl!newsfeed.xs4all.nl!newsfeed1.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.010 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'python.': 0.02; 'mixed': 0.09; 'shame': 0.09; 'val': 0.09; 'cc:addr:python-list': 0.11; '10:54,': 0.16; 'loops': 0.16; 'subject:python': 0.16; 'wrote:': 0.18; 'aug': 0.22; 'email addr:gmail.com>': 0.22; 'cc:addr:python.org': 0.22; 'exists': 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; '>': 0.26; 'header:In-Reply- To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; 'work.': 0.31; 'subject:end': 0.31; 'regular': 0.32; 'something': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'possible': 0.36; 'filter': 0.38; 'hope': 0.61; 'back': 0.62; 'to:addr:gmail.com': 0.65; 'sometimes.': 0.84; '2013': 0.98 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:to :cc:content-type; bh=h9rEv8fFpvxgqzhrVjFVWuZV423la/7EsPbQtZ8Ig78=; b=ct5P0a9hS0Sko44UDeT5kMQg8ZJ377H/FEenSneKb108kdM9MU+pzmtqf7M0VdKoWt 92uJnMoKXlUVlswwojWW5Tf8e245fHnbqD8HB2KJA6//98RhMAO6SL/mVG7Jd463b0Sp bymxPbQ+J1rwv54tPxXp09J+jKWFhRNGhMMWf8VvttiqBIKhFIK3HHONs71NA3kf+vgm DE+3+11IwogQ249uHYkuN8y3d63pONoyaf2CIjClKBLHHQd2UiNr55YfNv1bN8+/xQBJ JbG65CuyYcBE1TbQ7e0QH7W5GpNOJLultkV/5yTpbvqfN0TizlfWnmQEqdCAzpEAyBpm elQQ== MIME-Version: 1.0 X-Received: by 10.229.196.71 with SMTP id ef7mr2851424qcb.4.1377770524869; Thu, 29 Aug 2013 03:02:04 -0700 (PDT) In-Reply-To: References: <1377735506.18906.15.camel@debian> <1FETt.52607$Mw4.14965@fx15.am4> Date: Thu, 29 Aug 2013 11:02:04 +0100 Subject: Re: semicolon at end of python's statements From: =?ISO-8859-1?Q?F=E1bio_Santos?= To: Chris Angelico Content-Type: multipart/alternative; boundary=001a11c35e18b78b5e04e51332bf Cc: python-list@python.org 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: 38 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1377770554 news.xs4all.nl 15891 [2001:888:2000:d::a6]:59847 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:53234 --001a11c35e18b78b5e04e51332bf Content-Type: text/plain; charset=ISO-8859-1 On 29 Aug 2013 10:54, "Chris Angelico" wrote: > > foreach (some_array, mixed val) if (some_condition) > { > //do something with val > } > I hope that you don't mind that I have started to use this in JavaScript back at work. Its foreach loop requires you to do a filter all the time. It is a shame that this is not possible in python. for..if exists in comprehensions and not in regular loops but that would be nice sometimes. --001a11c35e18b78b5e04e51332bf Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable


On 29 Aug 2013 10:54, "Chris Angelico" <rosuav@gmail.com> wrote:
>
> foreach (some_array, mixed val) if (some_condition)
> {
> =A0 =A0 //do something with val
> }
>

I hope that you don't mind that I have started to use th= is in JavaScript back at work. Its foreach loop requires you to do a filter= all the time.

It is a shame that this is not possible in python. for..if e= xists in comprehensions and not in regular loops but that would be nice som= etimes.

--001a11c35e18b78b5e04e51332bf--