Interest check in some delicious syntactic sugar for "except:pass"

Chris Rebert clp2 at rebertia.com
Wed Mar 3 05:25:02 EST 2010


On Wed, Mar 3, 2010 at 1:27 AM, Oren Elrad <orenelrad at gmail.com> wrote:
> Howdy all, longtime appreciative user, first time mailer-inner.
>
> I'm wondering if there is any support (tepid better than none) for the
> following syntactic sugar:
>
> silence:
> ........ block
>
> ------------------------->
>
> try:
> ........block
> except:
> ........pass
>
> The logic here is that there are a ton of "except: pass" statements[1]
> floating around in code that do not need to be there.

So, why exactly should the language /encourage/ unnecessary error
silencing? (which is what the proposed sugar would do)

> I appreciate any feedback

Applicable rules of The Zen[1] that the proposal arguably violates:
*Special cases aren't special enough to break the rules.
*There should be one-- and preferably only one --obvious way to do it.

Cheers,
Chris
--
http://blog.rebertia.com

[1]: http://www.python.org/dev/peps/pep-0020/



More information about the Python-list mailing list