<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div style="color: rgb(0, 0, 0); font-family: 宋体, sans-serif; font-size: 14px;">Hi :</div><div style="color: rgb(0, 0, 0); font-family: 宋体, sans-serif; font-size: 14px;">I find bug for the use of keyword ‘with’, as follow:</div><div style="color: rgb(0, 0, 0); font-family: 宋体, sans-serif; font-size: 14px;"><pre style="overflow-x: auto; overflow-y: hidden; padding: 5px; color: rgb(51, 51, 51); line-height: 15.6px; border-top-width: 1px; border-bottom-width: 1px; border-style: solid none; border-top-color: rgb(170, 204, 153); border-bottom-color: rgb(170, 204, 153); widows: 1; background-color: rgb(238, 255, 204);"><span class="k" style="color: rgb(0, 112, 32); font-weight: bold;">with</span> <span class="nb" style="color: rgb(0, 112, 32);">open</span><span class="p">(</span><span class="s1" style="color: rgb(64, 112, 160);">'workfile'</span><span class="p">,</span> <span class="s1" style="color: rgb(64, 112, 160);">'r'</span><span class="p">)</span> <span class="k" style="color: rgb(0, 112, 32); font-weight: bold;">as</span> <span class="n">f</span><span class="p">:</span>
<span class="n">read_data</span> <span class="o" style="color: rgb(102, 102, 102);">=</span> <span class="n">f</span><span class="o" style="color: rgb(102, 102, 102);">.</span><span class="n">read</span><span class="p">()</span>
<span class="n">f</span><span class="o" style="color: rgb(102, 102, 102);">.</span><span class="n">closed</span></pre></div><div><div id=""><div>url:<a href="https://docs.python.org/2/tutorial/inputoutput.html">https://docs.python.org/2/tutorial/inputoutput.html</a></div><div><br></div><div>f.closed is not necessary, as ‘with’ <span style="color: rgb(34, 34, 34); font-size: 14px; white-space: pre-wrap; widows: 1; background-color: rgb(255, 255, 255);"><font face="宋体"> is very good handling exceptions</font></span></div><div><span style="color: rgb(34, 34, 34); font-family: 'Segoe UI', 'Lucida Grande', 'Lucida Sans Unicode', Helvetica, Arial, Verdana, sans-serif; font-size: 14px; white-space: pre-wrap; widows: 1; background-color: rgb(255, 255, 255);"><br></span></div><div>Thinks!</div><div style="color: rgb(0, 0, 0); font-family: 宋体, sans-serif; font-size: 14px;"><font color="#999999" face="宋体,sans-serif"><br></font></div><div style="color: rgb(0, 0, 0); font-family: 宋体, sans-serif; font-size: 14px;"><font color="#999999" face="宋体,sans-serif">--</font></div><div style="color: rgb(0, 0, 0); font-family: 宋体, sans-serif; font-size: 14px;"><font color="#999999">Growth-RD F2-403 </font><span style="color: rgb(153, 153, 153); font-family: -webkit-standard; font-size: medium;">谭奇</span></div><div style="color: rgb(0, 0, 0); font-family: 宋体, sans-serif; font-size: 14px;"><span style="color: rgb(153, 153, 153); font-family: -webkit-standard; font-size: medium;">TEL:18513622028</span></div></div></div></body></html>