Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #5904

Re: Overuse of try/except/else?

References <BANLkTikAZbUxnqA2o-Gu439Vn44P_mFeZA@mail.gmail.com> <20110521054020.GA32313@cskk.homeip.net>
From James Mills <prologic@shortcircuit.net.au>
Date 2011-05-21 17:08 +1000
Subject Re: Overuse of try/except/else?
Newsgroups comp.lang.python
Message-ID <mailman.1875.1305961727.9059.python-list@python.org> (permalink)

Show all headers | View raw


On Sat, May 21, 2011 at 3:40 PM, Cameron Simpson <cs@zip.com.au> wrote:
> These days I think I'd use a LateFunction (a facility of my own which is
> a lot like the futures module) which returns a callable when you submit
> a function; the worker thread runs the submitted function and catches the
> return value or raised exception. Anyone who calls the returned callable
> later gets the return value or the exception reraised as appropriate,
> so one can avoid the dangerous "catch everything and log" scenario.

I like this :) I guess you call this a Proxy Object although
your calling it a LateFunction seems more "fitting" :)

cheers
James

-- 
-- James Mills
--
-- "Problems are solved by method"

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Overuse of try/except/else? James Mills <prologic@shortcircuit.net.au> - 2011-05-21 17:08 +1000

csiph-web