Function to determine list max without itertools

Chris Angelico rosuav at gmail.com
Mon Apr 22 12:48:34 EDT 2019


On Tue, Apr 23, 2019 at 12:45 AM Grant Edwards
<grant.b.edwards at gmail.com> wrote:
> At the very top level _sometimes_ you want to have one single, global,
> try/except to catch all exceptions and handle the nofication and exit
> in a non-default way.  For example: in a GUI application, it's
> possible that nobody will see an excption message and stack trace
> that's sent to stderr.  A good GUI framework would already handle
> that, but not all do.

I describe that as a "boundary". You can sometimes have those inside
an application, too; for instance, a web server will often want to
catch any unhandled exception during a request handler, log it
somewhere, send an HTTP 500 back to the client, and go back to serving
requests. General principle: a boundary layer will catch EVERY
exception and log them as part of handling them; everything else will
catch only what it can actually handle (and recover from), and usually
won't log them.

ChrisA


More information about the Python-list mailing list