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


Groups > comp.lang.python > #98002

Modern recommended exception handling practices?

Newsgroups comp.lang.python
Date 2015-10-29 10:43 -0700
Message-ID <52739457-5f7a-48ea-8835-9fc8934174f9@googlegroups.com> (permalink)
Subject Modern recommended exception handling practices?
From vasudevram <vasudevram@gmail.com>

Show all headers | View raw


Hi list,

Are there any modern (i.e. for current versions of Python 2 and 3) recommended exception handling practices?

I've used some simple practices myself that I worked out, and seemed to make sense, but a) they may not cover many common cases (did it for the needs of a few specific projects), and there may of course be better methods.

I've googled for some relevant terms relating to my question, and found some links, including on python.org pages and StackOverflow, but at least the SO one I saw is from '09, so could well be outdated.

I realize that there may not be any recommended standard practices for this, or they may be more than one set, because of differences of opinion. For example, several years back, there was a somewhat controversial thread about, IIRC, checked vs. unchecked Java exceptions, maybe triggered by some post on Elliot Rusty Harold's site (he used to write a lot about Java, both blog posts and books).

Like to hear what people think and have to say about this, anyway, and more importantly, what they do and have found useful in practice.

I also realize my question may be too broad. Please feel free to suggest ways of constraining the problem. Maybe I will myself, in a reply in this thread.

Thanks in advance to all who reply.

- Vasudev Ram
jugad2.blogspot.com

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


Thread

Modern recommended exception handling practices? vasudevram <vasudevram@gmail.com> - 2015-10-29 10:43 -0700
  Re: Modern recommended exception handling practices? Steven D'Aprano <steve@pearwood.info> - 2015-11-03 17:47 +1100
    Re: Modern recommended exception handling practices? Chris Angelico <rosuav@gmail.com> - 2015-11-03 18:16 +1100
      Re: Modern recommended exception handling practices? Steven D'Aprano <steve@pearwood.info> - 2015-11-03 18:22 +1100
        Re: Modern recommended exception handling practices? Chris Angelico <rosuav@gmail.com> - 2015-11-03 18:52 +1100
      Re: Modern recommended exception handling practices? Paul Rubin <no.email@nospam.invalid> - 2015-11-03 11:59 -0800

csiph-web