Path: csiph.com!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: Mon, 21 Mar 2016 18:15:50 +1100 Lines: 29 Message-ID: References: <56e44258$0$1598$c3e8da3$5496439d@news.astraweb.com> <8737rvxs89.fsf@elektro.pacujo.net> <56e7483d$0$1608$c3e8da3$5496439d@news.astraweb.com> <56ef96f1$0$1516$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de cAiPozanrf0aSF2M2r7GcAh0U/2uwWY1ZM9UdO1kM6Vw== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'received:209.85.223': 0.03; '21,': 0.07; 'cc:addr:python-list': 0.09; '22,': 0.09; 'confuse': 0.09; 'mark.': 0.09; 'oh,': 0.09; 'subject:which': 0.09; 'python': 0.10; 'exception': 0.13; 'file,': 0.15; '2016': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'gained': 0.16; 'guilty': 0.16; 'naming': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'subject:?)': 0.16; 'wrote:': 0.16; 'pointed': 0.18; '>>>': 0.20; '(not': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'posted': 0.21; 'claiming': 0.22; 'lawrence': 0.22; 'code,': 0.23; 'code.': 0.23; 'header:In-Reply- To:1': 0.24; 'mon,': 0.24; 'chris': 0.26; 'compare': 0.27; 'message-id:@mail.gmail.com': 0.27; "people's": 0.29; "i'm": 0.30; 'convention': 0.30; 'certain': 0.31; 'everyone': 0.31; 'anyone': 0.32; 'up.': 0.32; 'returned': 0.32; "d'aprano": 0.33; "he's": 0.33; 'steven': 0.33; 'gets': 0.35; 'received:google.com': 0.35; 'so,': 0.35; 'attempt': 0.35; 'generic': 0.35; 'something': 0.35; 'level': 0.35; 'but': 0.36; 'there': 0.36; 'received:209.85': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'being': 0.37; 'expect': 0.37; 'doing': 0.38; 'version': 0.38; 'received:209': 0.38; 'mark': 0.40; 'subject:The': 0.61; 'more': 0.63; 'march': 0.64; 'mar': 0.65; 'better.': 0.66; 'results': 0.66; 'expert': 0.70; 'saw': 0.77; 'chrisa': 0.84; 'idiomatic': 0.84; 'promptly': 0.84; 'to:none': 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=SaiCkH4jEnh2GEKn5Y9g0upolsbLUsRjKHD/oGwmvfI=; b=g+ZDjZV50oB9WTB93f1SZvLrJYbVPU/FbHCZ55MEUVjELNfH7SDP1GSxG4hwBNH5t4 NTB6wqD/AABWBflybVmjXd9Kt6QFZouSqlDnOIONyiq217SNI9ioFuPWdluB+ekAMSrt bGqV3PqwTFny+Rzkk+8mdPimGDO+0OyocsafneQ1KVT1Yh4JVHoS5XRH0WZmvnWZaWAp /uVAlTrsiKxXvJL2+8QUZNpA70fjfofc/ZHQfwOR7M7H6wqSqgpRgWB87h575IdHH9XQ jwzntsbTYNsxgGgkPA9Bas7HMcXgFEtIHdVx4zQ5YAkxC7NelsXygGIfc//mL3ONumQq eq5A== 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=SaiCkH4jEnh2GEKn5Y9g0upolsbLUsRjKHD/oGwmvfI=; b=eCOyvnuz6jv9vbnyKk03tUWRPdy2nN+VJTpOAMsgo7+sClOB60IpMOD2w3Hl/NWHQP KWeSxugNUoipVE+X6RJlsfX7auqhlTiUfJ8fNp5+sCbkQCYYvTJ5va9ofKSrgT5L4DWe 9cjLWlWKKHceSE2z6w5SuKONnLtBIYEGDpiU4TQn1dD9MCfeA+0NtiwK85CFY1bNFSqo ZkSDpME5n+3D2gKciyR/hAD+QfLZHH28V1AA5nxKHFKEJg/V+nYrCQee4WGb10BcpFZX yEfFCkvchodboddOeU6Tye2vpxFsduisj8I5T8iE3/OJJBX7zw5LEK9xAmP5lnC173K7 wycw== X-Gm-Message-State: AD7BkJKe1clBgH+tbiAzi92HLMtFIGANpF+eXDT821Xxqe4xtrncMzLzHJ6YINEgm0390536D9YoUCMHS8LNVQ== X-Received: by 10.107.128.104 with SMTP id b101mr26200526iod.31.1458544550874; Mon, 21 Mar 2016 00:15:50 -0700 (PDT) In-Reply-To: <56ef96f1$0$1516$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:105343 On Mon, Mar 21, 2016 at 5:38 PM, Steven D'Aprano wrote: > On Monday 21 March 2016 12:35, Chris Angelico wrote: > >> On Mon, Mar 21, 2016 at 12:28 PM, Mark Lawrence >> wrote: >>> I got to line 22, saw the bare except, and promptly gave up. >> >> Oh, keep going, Mark. It gets better. > [...] >> So, if any exception happens during the reading of the file, it gets >> squashed, and 0 is returned - which results in a generic message being >> printed, and the program terminating, with return value 0. Awesome! > > > While there is a certain level of entertainment to be gained from snarking > at other people's bad code, and I'm as guilty as anyone else for doing so, > please remember that Bart is engaged in a good-faith attempt to compare > Python to other dynamic code. He's not claiming to be a Python expert or > that he's writing idiomatic Python code. Given that the exact same issue was pointed out the last time he posted a version of this code, I have less sympathy and more snark. I completely understand that not everyone understands what's idiomatic Python code; but when something is pointed out as a deadly anti-pattern (not just "that naming convention might confuse people"), I would expect to see changes. ChrisA