Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed6.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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python,': 0.01; 'pointer': 0.05; 'subject:Python': 0.06; 'python': 0.08; 'array.': 0.09; 'programmers.': 0.09; 'rejected.': 0.09; 'tends': 0.09; 'am,': 0.13; 'wrote:': 0.15; 'clear.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'iterator': 0.16; 'iterators,': 0.16; 'pointers': 0.16; 'versus': 0.16; '16,': 0.16; 'level,': 0.19; 'received:209.85.210.174': 0.19; 'received:mail- iy0-f174.google.com': 0.19; 'loop': 0.22; "doesn't": 0.22; 'header :In-Reply-To:1': 0.22; 'code.': 0.22; 'personally,': 0.23; '(or': 0.25; "i'm": 0.27; 'skip:p 30': 0.28; 'discussed': 0.28; 'sat,': 0.28; 'message-id:@mail.gmail.com': 0.28; 'array': 0.30; 'not.': 0.30; 'arithmetic': 0.30; 'btw,': 0.30; 'construct': 0.30; 'iterating': 0.30; 'subject:?': 0.31; 'error': 0.31; 'chris': 0.32; 'certainly': 0.32; "who's": 0.32; 'list': 0.32; 'too': 0.32; 'does': 0.32; 'done': 0.33; 'to:addr:python-list': 0.34; 'there': 0.34; 'however,': 0.34; 'someone': 0.34; 'do?': 0.35; 'latter': 0.35; 'familiar': 0.36; 'operations': 0.36; 'issue': 0.37; 'convenient': 0.37; 'but': 0.37; 'could': 0.37; 'received:google.com': 0.38; 'not,': 0.38; 'received:209.85': 0.38; 'subject:: ': 0.38; 'allows': 0.39; 'to:addr:python.org': 0.39; 'received:209': 0.40; 'matter': 0.61; 'perfectly': 0.64; 'due': 0.66; 'low': 0.74; 'readability': 0.84; 'suffer': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=7x+gDqWJW6ArGAf0TQuNUk5EfAz6ZjhZQgk98UK1TZ0=; b=q0tMEtlbpE7QxMMIsVqIfsDQTd+FY3EHDvZSJ4dJwy63sRKDFTjsOJ7kUwAtBkYtpA m51fRbhFkURMcgIgYNTGQ4fvLnDwvxF5xCIdEtUCwgCIrAWCKeWTkK+TYHeYp8o4h9zk XjxA5JVdwth4yPApRiNJ+ldxdRpYjDWIBtkXQ= MIME-Version: 1.0 In-Reply-To: References: Date: Sat, 16 Jul 2011 08:51:34 +1000 Subject: Re: Python ++ Operator? From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 26 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1310770297 news.xs4all.nl 23962 [2001:888:2000:d::a6]:57514 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:9577 On Sat, Jul 16, 2011 at 6:26 AM, Dan Stromberg wrote: > > I don't regard this as a low level versus VHLL issue - I regard it as a > matter of operators with side effects being too error prone.=A0 Adding su= ch > operators to Python has been discussed (it'd almost certainly be easy to > add), and rejected. It's not that it has or has not, due to its highness of level, but more a needs or needs not. In Python, iterating over an array is done with a for loop and the array's own iterator (or enumerate() if you need the indices), but C doesn't have iterators, so it needs a convenient notation for incrementing through the array. > BTW, array operations optimize to the same thing as pointer arithmetic in > most C compilers, but the latter tends to be less clear. I'm not fully convinced; there are many times when incrementing pointers allows for much cleaner code. However, we are talking about the readability of C among Python programmers. Personally, I find pointer-dereference-and-post-increment to be perfectly readable, but it's a construct that I use practically on a daily basis. To someone who's not familiar with Python, list comps could suffer from the same issues - what does THIS do? oh. Chris Angelico