A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2005-August/055419.html below:

[Python-Dev] PEP 348 (exception reorg) revised again

[Python-Dev] PEP 348 (exception reorg) revised again [Python-Dev] PEP 348 (exception reorg) revised againRaymond Hettinger raymond.hettinger at verizon.net
Mon Aug 15 15:47:54 CEST 2005
> > It is completely Pythonic to have bare keywords
> > apply a useful default as an aid to readability and ease of coding.

[Oleg]
>    Bare "while:" was rejected because of "while WHAT?!". Bare
"except:"
> does not cause "except WHAT?!" reaction. Isn't it funny?! (-:

It's both funny and interesting.  It raises the question of what makes
the two different -- why is one instantly recognizable and why does the
other trigger a gag reflex.  My thought is that bare excepts occur in a
context that makes their meaning clear:

    try:
        block()
    except SpecificException:
        se_handler()
    except:
        handle_everything_else()

The pattern of use is similar to a "default" in a switch-case construct.
Viewed out-of-context, one would ask "default WHAT".  Viewed after a
series of case statements, the meaning is vividly clear.


Raymond

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4