Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #27765
| Path | csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <rosuav@gmail.com> |
| 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; 'python': 0.09; 'block.': 0.09; 'semantics': 0.09; 'terms,': 0.09; 'aug': 0.13; '24,': 0.16; 'closures': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'lambda': 0.16; 'subject:arithmetic': 0.16; 'try/except': 0.16; 'wrote:': 0.17; '>>>': 0.18; 'all,': 0.21; 'received:209.85.214.174': 0.21; 'header:In-Reply-To:1': 0.25; 'am,': 0.27; 'plain': 0.27; 'message-id:@mail.gmail.com': 0.27; '0.5': 0.29; 'wrap': 0.29; 'fri,': 0.30; 'to:addr:python-list': 0.33; 'received:google.com': 0.34; 'done': 0.34; 'received:209.85': 0.35; 'but': 0.36; 'received:209': 0.37; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'received:209.85.214': 0.39; 'little': 0.39; 'header:Received:5': 0.40; 'hassle.': 0.84; '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:to :content-type; bh=yQZddz1w3Mg9viLcDYgvhQTZkzM4eQ7w1F+goDoGxCo=; b=TLNsu25+SX0SzWEZcxb8zr7RZEBkVH0kJskVcylOM3iqGeKTqgVHUG1ziyYR+R8CoQ Z1UIWBsFUgZ6CARv1cKrW8T9zs90Z6eL5VVr78FjwGfQshYf3+01931eo2QNv+ZdJSVl xBHlLpslXgKavSHt77wBwlcVaAOfQepM9KTHq6tpuIU4loxPPHhBgSnGmNL8ePZYkRFY wZHkFWqVw9706EKaKDnIsowMS1m4ikmTjvVjEO7MtC4n8OXHf/UKm1gM8dE99JwaJ/HD zrzj8Hbpd5CEz5pnWsVSJS8s4PfjsWyamuqw05XNQnJilErUUkMoTmdAz3WEU2x+DfR2 kmvw== |
| MIME-Version | 1.0 |
| In-Reply-To | <34uc389nu5u681tdadp23l8ksnhcrjv0s2@invalid.netcom.com> |
| References | <8b9a5844-66b0-4940-946a-5e626462cdce@googlegroups.com> <34uc389nu5u681tdadp23l8ksnhcrjv0s2@invalid.netcom.com> |
| Date | Fri, 24 Aug 2012 07:48:20 +1000 |
| Subject | Re: Guarding arithmetic |
| From | Chris Angelico <rosuav@gmail.com> |
| To | python-list@python.org |
| Content-Type | text/plain; charset=ISO-8859-1 |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.12 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.3732.1345758509.4697.python-list@python.org> (permalink) |
| Lines | 19 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1345758509 news.xs4all.nl 6920 [2001:888:2000:d::a6]:57207 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:27765 |
Show key headers only | View raw
On Fri, Aug 24, 2012 at 4:49 AM, Dennis Lee Bieber <wlfraed@ix.netcom.com> wrote: > By the time you wrap the equation with a lambda all, named, terms, > AND supply the named terms after the lambda, you might as well just wrap > the equation in a plain try/except block. But closures spare you that hassle. >>> a=1 >>> b=0 >>> print(safe(lambda: a/b)) 42 >>> b=2 >>> print(safe(lambda: a/b)) 0.5 (Example done in Python 3 so semantics are a little different) ChrisA
Back to comp.lang.python | Previous | Next — Previous in thread | Find similar | Unroll thread
Guarding arithmetic Mark Carter <alt.mcarter@gmail.com> - 2012-08-23 02:05 -0700
Re: Guarding arithmetic Chris Angelico <rosuav@gmail.com> - 2012-08-23 19:16 +1000
Re: Guarding arithmetic Mark Carter <alt.mcarter@gmail.com> - 2012-08-23 02:22 -0700
Re: Guarding arithmetic Chris Angelico <rosuav@gmail.com> - 2012-08-23 19:29 +1000
Re: Guarding arithmetic Mark Carter <alt.mcarter@gmail.com> - 2012-08-23 02:22 -0700
Re: Guarding arithmetic Laszlo Nagy <gandalf@shopzeus.com> - 2012-08-23 11:23 +0200
Re: Guarding arithmetic Mark Carter <alt.mcarter@gmail.com> - 2012-08-23 02:47 -0700
Re: Guarding arithmetic Mark Carter <alt.mcarter@gmail.com> - 2012-08-23 02:47 -0700
Re: Guarding arithmetic Laszlo Nagy <gandalf@shopzeus.com> - 2012-08-23 11:28 +0200
Re: Guarding arithmetic Chris Angelico <rosuav@gmail.com> - 2012-08-23 19:30 +1000
Re: Guarding arithmetic Peter Otten <__peter__@web.de> - 2012-08-23 12:11 +0200
Re: Guarding arithmetic rusi <rustompmody@gmail.com> - 2012-08-23 10:15 -0700
Re: Guarding arithmetic Laszlo Nagy <gandalf@shopzeus.com> - 2012-08-23 13:01 +0200
Re: Guarding arithmetic MRAB <python@mrabarnett.plus.com> - 2012-08-23 12:21 +0100
Re: Guarding arithmetic Peter Otten <__peter__@web.de> - 2012-08-23 13:28 +0200
Re: Guarding arithmetic Mark Lawrence <breamoreboy@yahoo.co.uk> - 2012-08-23 15:11 +0100
Re: Guarding arithmetic Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-08-23 14:49 -0400
Re: Guarding arithmetic Chris Angelico <rosuav@gmail.com> - 2012-08-24 07:48 +1000
csiph-web