Interest check in some delicious syntactic sugar for "except:pass"
python at mrabarnett.plus.com
Wed Mar 3 16:19:56 CET 2010
Oren Elrad 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:
> ........ block
> The logic here is that there are a ton of "except: pass" statements
> floating around in code that do not need to be there. Meanwhile, the
> potential keyword 'silence' does not appear to be in significant use
> as a variable, or an alternative keyword might be imagined
> ('quiet', 'hush', 'stfu') but I somewhat like the verbiness of
> 'silence' since that is precisely what it does to the block (that is,
> you have to inflect it as a verb, not a noun -- you are telling the
> block to be silent). Finally, since this is the purest form of
> syntactic sugar, I cannot fathom any parsing, interpreting or other
> complications that would arise.
> I appreciate any feedback, including frank statements that you'd
> rather not trifle with such nonsense.
>  http://www.google.com/codesearch?q=except%3A\spass&hl=en
>  http://www.google.com/codesearch?hl=en&lr=&q=silence+lang%3Apy
Bare excepts are a very bad idea. And you want syntactic sugar for them?
More information about the Python-list