![](https://secure.gravatar.com/avatar/01aa7d6d4db83982a2f6dd363d0ee0f3.jpg?s=120&d=mm&r=g)
On Jul 02, 2013, at 06:37 PM, Matthew Lefavor wrote:
As you all know, Python supports a compound "with" statement to avoid the necessity of nesting these statements.
Unfortunately, I find that using this feature often leads to exceeding the 79-character recommendation set forward by PEP 8.
Yeah, I noticed and brought this up a while ago. I thought I filed a bug but can't find it. It would have been closed Won't Fix anyway. As others have pointed out, you can usually rewrite such long with-statements to conform to the PEP 8 line lengths by e.g. saving the paths in a shorter named local variable), using Python 3.3's ExitStack, which is awesome btw, or just using backslashes. Remember PEP 8 isn't a weapon to be wielded by a stern Auntie Tim Peters. As for relaxing PEP 8, well, I'm not sure what more you'd want it to say. It currently reads: The preferred way of wrapping long lines is by using Python's implied line continuation inside parentheses, brackets and braces. Long lines can be broken over multiple lines by wrapping expressions in parentheses. These should be used in preference to using a backslash for line continuation. which seems about right to me. It is preferred to use implied continuation over backslashes, but doesn't say "don't use backslashes". They're not evil, just not preferred, so use them where appropriate and with good judgment. Cheers, -Barry