Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!eternal-september.org!feeder.eternal-september.org!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed2.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.009 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'programmer': 0.03; 'augmented': 0.09; 'subject:number': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'assignments,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'semantics': 0.16; 'wrote:': 0.18; 'code.': 0.18; 'slightly': 0.19; 'aug': 0.22; 'cc:addr:python.org': 0.22; "aren't": 0.24; 'mon,': 0.24; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'tim': 0.29; 'subject:list': 0.30; 'message-id:@mail.gmail.com': 0.30; '(although': 0.31; 'chase': 0.31; 'omitted': 0.31; 'regular': 0.32; 'subject:the': 0.34; 'knows': 0.35; 'received:google.com': 0.35; 'pm,': 0.38; 'is.': 0.60; 'course': 0.61; 'such': 0.63; 'different': 0.65; 'subject:get': 0.81; '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=EBDqaDxHmV+UeglrdTao6qg1FJoCl72Z4wNZjZIV33k=; b=r/Rn9Tf/kr7I1p1Sj2BCaPwIt2etEx1nMPNKJuOlJ6Ca+e2PKvQb3L5jop6SWzcJYI 28rHgs64RzPLf6/1yffpNhudQz8H1m8YbkxcSHG6CjEDB2eosUJ8wnK+lag+i7z/oGfa msU+kUqwpFGMmmUtK4czHrkhJRkfInEf1tFJb4w2FqaPiS7Im+adsKJyu+KTo5U6NaB0 sXDr/tAApwPM6CzOKFUqCAMOKUhs28vg9fxILA6uSfcffkVNp8zOqB8U3ADJwhAHmzus bharb73drQ0FOWL0Rp/mfgRLKRO3WmGHbUg4OM7T1qsMALG1TE5/nrjViOeiR06xTKVW +x0Q== MIME-Version: 1.0 X-Received: by 10.42.230.212 with SMTP id jn20mr31557800icb.59.1407761619624; Mon, 11 Aug 2014 05:53:39 -0700 (PDT) In-Reply-To: <87ppg7urk2.fsf@elektro.pacujo.net> References: <53E658CD.5020904@gmail.com> <53e59035$0$29998$c3e8da3$5496439d@news.astraweb.com> <338e8fb0-c9ec-462a-b560-1c1ff77de17e@googlegroups.com> <154cc342-7f85-4d16-b636-a1a953913c98@googlegroups.com> <8c41d779-0c26-430a-a915-08c2b962e0e7@googlegroups.com> <87ppg7urk2.fsf@elektro.pacujo.net> Date: Mon, 11 Aug 2014 22:53:39 +1000 Subject: Re: how to get the ordinal number in list 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: 18 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1407761627 news.xs4all.nl 2928 [2001:888:2000:d::a6]:45305 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:76057 On Mon, Aug 11, 2014 at 10:41 PM, Marko Rauhamaa wrote: > Tim Chase : > >> Pish, such redundancy...everyone knows a C programmer would write >> that as >> >> x ^= y >> y ^= x >> x ^= y > > Aren't you forgetting something? I don't think he is. Those are augmented assignments, just as Python has (although with slightly different semantics in some places). The semicolons can be omitted in some C REPLs, although they are of course mandatory in regular code. ChrisA