Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Chris Angelico Newsgroups: comp.lang.python Subject: Re: usage of try except for review. Date: Tue, 1 Mar 2016 04:38:20 +1100 Lines: 14 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de b0RsvYB1sedSJ0fBCHLe1gMCe0dwVvG8GEZo3J/WapKA== 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; 'received:209.85.223': 0.03; '"no"': 0.07; 'correct.': 0.07; 'cc:addr:python-list': 0.09; 'assume': 0.11; '"assert"': 0.16; '2016': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'subject:usage': 0.16; 'wrote:': 0.16; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'meant': 0.22; 'am,': 0.23; 'feb': 0.23; 'header:In-Reply-To:1': 0.24; 'mon,': 0.24; 'message-id:@mail.gmail.com': 0.27; 'work.': 0.30; 'tue,': 0.34; 'received:google.com': 0.35; 'replaced': 0.35; 'should': 0.36; 'received:209.85': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'no,': 0.38; 'received:209': 0.38; 'still': 0.40; 'your': 0.60; 'mar': 0.65; 'potentially': 0.67; 'chrisa': 0.84; 'subject:try': 0.84; 'to:none': 0.91; 'dennis': 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=vMQc++MGR1hqfJzVd5RXtHWofbaxG4zdYE/3vHCxraA=; b=wSDbAc/zU5iBHT2IKJ8OPmAE9dN9YKLX75og4cd2Rjlm0TylesBWDpD+vS03wD6s4o 1y7xAmDhRZnZNTYoX1uJHcHGD3oHT7S5RGVkSoef3n9C4nt+N9QzEQ7If3vDAl2DM8g9 gDamCLubxg0Gbd1XP1S5ACH6httf3yPcGDsnMiR++3nza0LVmog6oLNcx14ZdPXLtB2Z T84wRpjTI5NfQq9+4SK9YMSbTUB2m+fh+7tdT/I3WaKkCQWBDM2Qtn82GQ36EzJf1yRM xExp6WAT7DZitGG9SsmjeJGZjgoGf7NNVrRIOcLtmJwrakdlBCM3sSs3JM6cf4Pdw7tm iIwg== 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=vMQc++MGR1hqfJzVd5RXtHWofbaxG4zdYE/3vHCxraA=; b=KwBOLhsqNxkBjo6uyz5VzTsJF9ejGI1FZEh/NlXCQZwQCdLuFCAfm7Yr9hT1lJhwLk VgWsod7w9/vl7jnojKxKm4IpCQl8xPFeGflph5z+jnJV945zL7g6AqSTdqCJyKNK+XJT HutQNeM0tq+kjVDZPhCa6BtUNr01ZSnhyeSq+hyRspkm/hTX9N6VrVWIXFm2Une+T1/M WMfuNXWcbH9jbiNYGo3UDJN2rjPdKkXYpXZ74iQtpIjD+cfHRhPo1m0eRvTyBwFFFi8k 8M0T1wdocBEgQZkPzz1qPy5cLxXxru682998ODMKZyK8rDKrf19AOuBWP+mt8VeSSLDV 6n9g== X-Gm-Message-State: AD7BkJJWHpo2XilC8AWPlPbPx6XnygfVwlU49BTzh1dLupTLODKRYYTdAiM/bYzLF6QjZtL9CATzUjgNkJvjnw== X-Received: by 10.107.47.163 with SMTP id v35mr6042473iov.19.1456767500220; Mon, 29 Feb 2016 09:38:20 -0800 (PST) In-Reply-To: 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:103743 On Tue, Mar 1, 2016 at 4:34 AM, Ganesh Pal wrote: > On Mon, Feb 29, 2016 at 10:10 PM, Dennis Lee Bieber > wrote: > >> Ask yourself: Will my program still work if I remove all the assert >> statements. If the answer is "No", then you should not be using an assert. > > You meant if the answer is "NO" then I should be using asset ? No, Dennis was correct. You should assume that "assert" can potentially be replaced with "pass" and your program will continue to work. ChrisA