[Python-ideas] except expression

Alexander Belopolsky alexander.belopolsky at gmail.com
Thu Feb 20 16:23:21 CET 2014


On Thu, Feb 20, 2014 at 9:46 AM, Rob Cliffe <rob.cliffe at btinternet.com>wrote:

>
>
>> I also find it disturbing that people are actually considering
>> to use this expression form as a way to do quick&dirty suppression
>> of exceptions.
>>
> This is a relatively common construction (as a survey of my own small
> codebase indicates).  Quick, yes.  How dirty it is depends entirely on
> context, (and how readable it can be made) and is up to the programmer's
> judgment.


Isn't it what contextlib.suppress() [1] was invented for?  Do we need yet
another way to express the same?

http://docs.python.org/3.4/library/contextlib.html#contextlib.suppress
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20140220/47f087e5/attachment.html>


More information about the Python-ideas mailing list