Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed5.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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'exception': 0.03; 'interpreter': 0.04; 'removes': 0.05; 'arguments': 0.07; 'completeness': 0.07; 'exception.': 0.07; 'subject:adding': 0.07; 'suppose': 0.07; 'interpreter,': 0.09; 'received:155': 0.09; '"right"': 0.16; 'disclaimers': 0.16; 'disclaimers,': 0.16; 'from:addr:jpmorgan.com': 0.16; 'received:155.180': 0.16; 'received:155.180.234': 0.16; 'received:159.53': 0.16; 'received:169.70': 0.16; 'received:169.70.184': 0.16; 'received:bankone.net': 0.16; 'received:exchad.jpmchase.net': 0.16; 'received:jpmchase.com': 0.16; 'received:jpmchase.net': 0.16; 'received:svr.bankone.net': 0.16; 'securities,': 0.16; 'url:disclosures': 0.16; 'url:jpmorgan': 0.16; 'to:name:python- list@python.org': 0.20; 'trying': 0.21; 'do.': 0.21; 'stopping': 0.22; 'trace': 0.22; 'mention': 0.23; 'third-party': 0.23; 'received:169.254': 0.24; 'header:In-Reply-To:1': 0.25; 'accuracy': 0.27; '"in': 0.29; 'catching': 0.29; 'received:169': 0.29; '(including': 0.30; 'usually': 0.30; 'function': 0.30; 'header:Received:8': 0.30; 'code': 0.31; 'print': 0.32; 'raising': 0.33; 'to:addr:python-list': 0.33; 'me?': 0.33; 'agree': 0.34; 'wrong': 0.34; 'something': 0.35; 'there': 0.35; 'but': 0.36; 'should': 0.36; 'charset:us-ascii': 0.36; 'why': 0.37; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'your': 0.60; 'kind': 0.61; 'back': 0.62; 'production': 0.63; 'skip:n 10': 0.63; 'information': 0.63; 'information,': 0.63; 'url:email': 0.63; 'legal': 0.65; 'experience.': 0.65; 'subject': 0.66; 'purchase': 0.67; 'sale': 0.76; 'received:169.254.8': 0.84; 'subject:mode': 0.84; 'hassle': 0.91 X-DKIM: OpenDKIM Filter v2.1.3 sz2.jpmchase.com q6DH8VCW025357 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jpmorgan.com; s=smtpout; t=1342199311; bh=mOcOM2s/QKKBL4Bt1laBVWglfaq6mXgl6/Myu58D8dQ=; h=From:To:Subject:Date:Message-ID:References:In-Reply-To: Content-Transfer-Encoding:MIME-Version:Content-Type; b=VkF4bORMA4tR2V9lzVJ8PRmL1bty06ffL4Hd77VX37vAK8ZxqhLxkxv1l175CnF0A 6Wdul66PYbnaqXQEBc+7rtRUhPTkrBAB2ttCqY3n+uAob25fMxjvwLw28BT4OFNqxO faf9Y438H49kdyf0Jd7ku2FBNv9iAY5NC/i6etFI= From: "Prasad, Ramit" To: "python-list@python.org" Subject: RE: adding a simulation mode Thread-Topic: adding a simulation mode Thread-Index: AQHNYJ2RvIEMWnlORUqA95TdxMRilpcnrFMA///E5NA= Date: Fri, 13 Jul 2012 17:08:16 +0000 References: <87liiyr48f.fsf@handshake.de> <4fff8514$0$29965$c3e8da3$5496439d@news.astraweb.com> <50004de0$0$6876$e4fe514c@news2.news.xs4all.nl> In-Reply-To: <50004de0$0$6876$e4fe514c@news2.news.xs4all.nl> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.67.79.47] Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-DLP-FWD: Yes Content-Type: text/plain; charset="us-ascii" 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: 21 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1342199320 news.xs4all.nl 6972 [2001:888:2000:d::a6]:40098 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:25273 > > Please do NOT catch BaseException, since that is the wrong thing to do= =2E=0D=0A> =0D=0A> I would agree if you had said "in production code"=2E=0D= =0A> =0D=0A> If you are investigating why a third-party function is stoppin= g your=0D=0A> interpreter, then catching BaseException may tell you that th= e code=0D=0A> is raising the wrong kind of Exception=2E Once you know what= kind the=0D=0A> function is raising, you should catch only that particular= excpetion=0D=0A> subclass=2E=0D=0A=0D=0AI would say the opposite=2E In pro= duction code usually I want it=0D=0Ato recover, log as much information as = I need (including sending=0D=0Aany notifications), and NOT just die=2E=0D= =0A=0D=0AIn development, not catching the exception will give me a full =0D= =0Atrace back automatically=2E Why bother with trying to catch and =0D=0Apr= int something when the interpreter will do it for me? Not=0D=0Ato mention t= hat removes any hassle of trying to catch the=0D=0A"right" exception or fig= uring out the best way to print it=2E=0D=0AI suppose if there are arguments= on the exception that were not=0D=0Aprinted then I might want to catch it,= but has been rare=0D=0Ain my experience=2E=0D=0A=0D=0ARamit=0D=0A=0D=0AThi= s email is confidential and subject to important disclaimers and=0D=0Acondi= tions including on offers for the purchase or sale of=0D=0Asecurities, accu= racy and completeness of information, viruses,=0D=0Aconfidentiality, legal = privilege, and legal entity disclaimers,=0D=0Aavailable at http://www=2Ejpm= organ=2Ecom/pages/disclosures/email=2E