<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Feb 15, 2015 at 7:27 PM, Terry Reedy <span dir="ltr"><<a href="mailto:tjreedy@udel.edu" target="_blank">tjreedy@udel.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class="">On 2/15/2015 4:52 PM, Neil Girdhar wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
It's great that multiple context managers can be sent to "with":<br>
<br>
with a as b, c as d, e as f:<br>
suite<br>
<br>
If the context mangers have a lot of text it's very hard to comply with<br>
PEP8 without resorting to "\" continuations, which are proscribed by the<br>
Google style guide.<br>
</blockquote>
<br></span>
Untrue. " Backslashes may still be appropriate at times. For example, long, multiple with -statements cannot use implicit continuation, so backslashes are acceptable:<br></blockquote><div><br></div><div>Where are you looking at that? The one I see is here:</div><div><br></div><div><a href="https://google-styleguide.googlecode.com/svn/trunk/pyguide.html#Line_length">https://google-styleguide.googlecode.com/svn/trunk/pyguide.html#Line_length</a></div><div><br></div><div>Explicitly says:</div><div><br></div><p style="color:rgb(51,51,51);font-family:sans-serif;font-size:13.3333330154419px">Exceptions:</p><ul style="color:rgb(51,51,51);font-family:sans-serif;font-size:13.3333330154419px"><li>Long import statements.</li><li>URLs in comments.</li></ul><p style="color:rgb(51,51,51);font-family:sans-serif;font-size:13.3333330154419px"></p><div><span style="color:rgb(51,51,51);font-family:sans-serif;font-size:13.3333330154419px">Do not use backslash line continuation.</span></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
with open('/path/to/some/file/you/<u></u>want/to/read') as file_1, \<br>
open('/path/to/some/file/<u></u>being/written', 'w') as file_2:<br>
file_2.write(file_1.read())"<span class=""><br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Other statements like import and if support enclosing their arguments in<br>
parentheses to force aligned continuations. Can we have the same for<br>
"with"?<br>
</blockquote>
<br></span>
No. Considered and rejected because it would not be trivial.<span class=""><font color="#888888"><br>
<br></font></span></blockquote><div><br></div><div>If your argument is the amount of work, I might be able to find the time to do the work *if someone will promise to review it quickly*. I think it's not more than an afternoon to modify cpython.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class=""><font color="#888888">
-- <br>
Terry Jan Reedy</font></span><span class="im"><br>
<br>
______________________________<u></u>_________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org" target="_blank">Python-ideas@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-ideas" target="_blank">https://mail.python.org/<u></u>mailman/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" target="_blank">http://python.org/psf/<u></u>codeofconduct/</a><br>
<br></span><div class=""><div class="h5">
-- <br>
<br>
--- You received this message because you are subscribed to a topic in the Google Groups "python-ideas" group.<br>
To unsubscribe from this topic, visit <a href="https://groups.google.com/d/topic/python-ideas/y9rRQhVdMn4/unsubscribe" target="_blank">https://groups.google.com/d/<u></u>topic/python-ideas/<u></u>y9rRQhVdMn4/unsubscribe</a>.<br>
To unsubscribe from this group and all its topics, send an email to <a href="mailto:python-ideas%2Bunsubscribe@googlegroups.com" target="_blank">python-ideas+unsubscribe@<u></u>googlegroups.com</a>.<br>
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank">https://groups.google.com/d/<u></u>optout</a>.<br>
</div></div></blockquote></div><br></div></div>