What is the best way to split long line with several exceptions?
<p>Say I have next code:</p>

<pre><code>try:
    ...
except (some_lib.LongNameError1, lib.LongNameError2, lib.LongNameError3, lib.LongNameError3) as e:
    print str(e)
</code></pre>

<p>As you can see line with exceptions is too long.</p>

<p>I need to split it to meet requirement about a maximum of line length of 79 characters and keep readability at the same time.</p>

<p>Actually I've tried to look through standard library code examples but haven't find any suited example.</p>

<p>You could take advantage of using parenthesis like this:</p>

<pre><code>try:
    ...
except (some_lib.LongNameError1,
        some_lib.LongNameError2,
        some_lib.LongNameError3,
        some_lib.LongNameError4,
        some_lib.LongNameErrorN) as e:
    ...
</code></pre>

python python-2.7 exception