Path: csiph.com!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail From: Chris Angelico Newsgroups: comp.lang.python Subject: Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?) Date: Fri, 25 Mar 2016 01:01:43 +1100 Lines: 38 Message-ID: References: <56e44258$0$1598$c3e8da3$5496439d@news.astraweb.com> <8737rvxs89.fsf@elektro.pacujo.net> <56e7483d$0$1608$c3e8da3$5496439d@news.astraweb.com> <56ef9787$0$1516$c3e8da3$5496439d@news.astraweb.com> <56f02196$0$1588$c3e8da3$5496439d@news.astraweb.com> <56f3f09a$0$1595$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de 4hokDFXrMZI+lEorcDWjbwet2MnlAYEZjPVzvjkyD2SA== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.005 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'cc:addr:python-list': 0.09; '-1,': 0.09; 'likewise': 0.09; 'slow.': 0.09; 'subject:which': 0.09; 'thread': 0.10; 'python': 0.10; 'python.': 0.11; 'thu,': 0.15; '0):': 0.16; '12:50': 0.16; '2016': 0.16; 'evaluating': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'heed': 0.16; 'iterating': 0.16; 'pythonic': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'subject:?)': 0.16; 'wrote:': 0.16; 'pointed': 0.18; 'language': 0.19; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'programming': 0.22; 'am,': 0.23; 'code,': 0.23; 'this:': 0.23; 'header:In-Reply-To:1': 0.24; 'chris': 0.26; 'fri,': 0.27; 'least': 0.27; 'message- id:@mail.gmail.com': 0.27; 'complain': 0.29; 'respects': 0.29; 'print': 0.30; 'you?': 0.30; "we're": 0.30; 'code': 0.30; 'point': 0.33; 'changed': 0.33; 'problem': 0.33; "d'aprano": 0.33; "he's": 0.33; 'point,': 0.33; 'steven': 0.33; 'list': 0.34; 'received:google.com': 0.35; 'list:': 0.35; 'but': 0.36; 'instead': 0.36; 'received:209.85': 0.36; 'depends': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'agree': 0.37; 'expect': 0.37; 'starting': 0.37; 'received:209': 0.38; 'someone': 0.38; "didn't": 0.39; 'still': 0.40; 'him': 0.60; 'subject:The': 0.61; 'skip:n 10': 0.62; 'mar': 0.65; 'here': 0.66; 'obvious': 0.76; 'counts': 0.81; 'chrisa': 0.84; 'fortunately': 0.84; 'habit.': 0.84; 'obvious.': 0.84; 'to:none': 0.91; 'clearing': 0.91 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; bh=NdiI7zeX50ebcbp31OzK3aHooYTdvtl4lTerLYwud9I=; b=Umt6KgUIPlRnPqoL49yWEoABHsz4V0ahiLXKciAxhFGZxA0G+e9PYNLHIzZu0jGgm4 35MX+YLRb/B0jsreqIwhqkKZk8cASod3k+Y4tlzyNQ9RqLV08HmBTWbi876VMQWFvnnR eqJlOh/VolW2F3+G2Pw0hMIbKtox8Pr2Bmsu6Cl9KAyF11k74MdDyTOMa2ufXBjq2HZ0 EInSejgHbhy52rZIjCnVSS+wvSPLcSHY0hcn+0JXF01Gaqd6IYqmJOMJD6cwX0htCWdQ caCmneLhCiNWmt9TfeEjLSR0hcdQ5VNCJ3yYFbZdbqWs6sO/EPzoH2QTgLgZlOjjRljz fYDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:cc; bh=NdiI7zeX50ebcbp31OzK3aHooYTdvtl4lTerLYwud9I=; b=FXiJy3lVggAEAT0sWBaskZcWLOZsDyd+eGUqMytomoBHZw/Fx5hRRfWBcx4kbYzE0d 3LGKim8z1rOreH+CDNtGJD+0bdf8D1Ctw55DtNqBiNOAEWGjoJR139LRxoOzP1aDUxic czWfZM0sbIjCOh7uzriBmTu8ygEmZhEqH11Zk8fy2XjzHgkz3oC2yT5yyym64zY+dtD/ eo8HrWpH6sDUuOkVX7dc7sablv7JhB+dkplUE46ZedR23LDBr0AQq+qxpW7KA/lZcuom dF6hpZeUpcIAcpOzBhlOpURaYQONP6rfTKH9gQZVY8Ejj8mpNdFB/k3zxfew0rOduVO/ DXhg== X-Gm-Message-State: AD7BkJJvxIwj6N723H/9MlxPo4Ka9Wqqkz4bS645ZAJ1k68HuRjrM7DU4VUSpnKtw2bB/EuzC86CIsTjwAFSew== X-Received: by 10.113.4.4 with SMTP id ca4mr1278461lbd.6.1458828103705; Thu, 24 Mar 2016 07:01:43 -0700 (PDT) In-Reply-To: <56f3f09a$0$1595$c3e8da3$5496439d@news.astraweb.com> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:105611 On Fri, Mar 25, 2016 at 12:50 AM, Steven D'Aprano wrote: > On Thu, 24 Mar 2016 02:24 pm, Chris Angelico wrote: > > >> This is how you're currently evaluating Python. Instead of starting >> with the most simple and obvious code > > One problem is that what counts as "simple and obvious" depends on what you > are used to. Coming from a background of Pascal, iterating over a list like > this: > > for i in range(len(mylist)): > print mylist[i] > > was both simple and obvious. It took me years to break myself of that habit. > > Likewise clearing a list: > > for i in range(len(mylist)-1, -1, 0): > del mylist[i] > > > Fortunately I didn't need to do that very often. > > The point is that you, like most of the prominent posters here, have many > years of experience in programming in Python. How do you expect Bart to > come up with the same "simple and obvious" code as you? I don't, until it's pointed out. At that point, someone who respects the language will at least pay *some* heed to the changed recommendations; what we're seeing here is that he continues to use C idioms and then complain that Python is slow. I don't expect him to magically know what Python idioms are, but when the thread has gone on this long and he's still showing the same style of code, that's when I start to agree with Ben that he's not paying heed to Pythonic vs non-Pythonic. ChrisA