Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Ian Kelly Newsgroups: comp.lang.python Subject: Re: Try: rather than if : Date: Mon, 14 Dec 2015 16:12:26 -0700 Lines: 6 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de j75qUwdqeSAtiQvBpkcL3Q47Bq1JVHS1ZJNdFQaGBWgQ== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.028 X-Spam-Evidence: '*H*': 0.94; '*S*': 0.00; 'used.': 0.05; 'another?': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'wrote:': 0.16; 'attribute': 0.18; '2015': 0.20; 'seems': 0.23; 'dec': 0.23; 'header:In-Reply-To:1': 0.24; 'mon,': 0.24; 'message- id:@mail.gmail.com': 0.27; '14,': 0.27; 'code': 0.30; 'statement': 0.32; 'handle': 0.34; 'received:google.com': 0.35; 'could': 0.35; 'there': 0.36; 'received:209.85': 0.36; 'to:addr:python-list': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'received:209.85.213': 0.37; 'received:209': 0.38; 'to:addr:python.org': 0.40; 'to:name:python': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=Wkq63ZNs34P/LaKs8QCji6uXnsK0UsBaVxQUn4GmOsM=; b=CT6kzBVlpk3dK+Q+ZoURwGQW5wRHk1al7n+X/u3Au+c3tsbKWbyO6qz4W7CvgOiDFD /U4dxbtSGLQivd8kkAvEDNTQ1d+NXKg8xXr45HGj9SAKIgbBynxl3N5C6It6EYFD0iXu RSg465QK0SxZSRxQWINLg3yNrjYmSuyJKbGsIaN3Hb4c2kQpXs+QRxS8UAF+HGg8mR8e NXs9Dl4addFAiKqicHT23BaiYUMDDLfrW20o+WAfaI+OcVgtpmKN/DMnbvkOmj2ydXAA zr89I14sQtXC0kt/qEwm3OedOKGbfsSAiCslkVUI4skW0CU49aayKHZ19q6s+NOeUjfl Vw/w== X-Received: by 10.50.154.5 with SMTP id vk5mr799382igb.85.1450134785989; Mon, 14 Dec 2015 15:13:05 -0800 (PST) In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ 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:100434 On Mon, Dec 14, 2015 at 3:38 PM, Vincent Davis wrote: > In the code below try is used to check if handle has the attribute name. It > seems an if statement could be used. Is there reason one way would be > better than another? http://www.oranlooney.com/lbyl-vs-eafp/