<html><head>
<meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type">
</head><body bgcolor="#FFFFFF" text="#000000">
<div style="margin:30px 25px 10px 25px;" class="__pbConvHr"><div
style="display:table;width:100%;border-top:1px solid
#EDEEF0;padding-top:5px"> <div
style="display:table-cell;vertical-align:top;padding-right:6px;padding-top:2px;width:31px;"><img
photoaddress="storchaka@gmail.com" photoname="Serhiy Storchaka"
src="cid:part1.05090905.02080802@umbrellacode.com"
name="compose-unknown-contact.jpg" height="25px" width="25px"></div> <font
color="#737F92"><div
style="display:table-cell;white-space:nowrap;vertical-align:top;width:100%">
<span style="padding-right:6px;font-weight:bold"><b>From:</b> Serhiy
Storchaka <a class="moz-txt-link-rfc2396E" href="mailto:storchaka@gmail.com"><storchaka@gmail.com></a><br></span><font color="#737F92"><b>Date:</b>
February 2, 2013 5:50 AM<br><b>To:</b> <a class="moz-txt-link-abbreviated" href="mailto:python-ideas@python.org">python-ideas@python.org</a><br><b>Subject:</b>
[Python-ideas] for line in input with open(path) as input...<br></font></div>
</font></div></div>
<div style="color:#888888;margin-left:24px;margin-right:24px;"
__pbrmquotes="true" class="__pbConvBody"><br>
<br>When should iterwith() call __exit__()?
</div>
<br>
<div style="margin:30px 25px 10px 25px;" class="__pbConvHr"><div
style="display:table;width:100%;border-top:1px solid
#EDEEF0;padding-top:5px"> <div
style="display:table-cell;vertical-align:top;padding-right:6px;padding-top:2px;width:31px;"><img
photoaddress="shane@umbrellacode.com" photoname="Shane Green"
src="cid:part1.05090905.02080802@umbrellacode.com"
name="compose-unknown-contact.jpg" height="25px" width="25px"></div> <font
color="#737F92"><div
style="display:table-cell;white-space:nowrap;vertical-align:top;width:100%">
<span style="padding-right:6px;font-weight:bold"><b>From:</b> Shane
Green <a class="moz-txt-link-rfc2396E" href="mailto:shane@umbrellacode.com"><shane@umbrellacode.com></a><br></span><font color="#737F92"><b>Date:</b>
February 2, 2013 5:55 AM<br><b>To:</b> Serhiy Storchaka
<a class="moz-txt-link-rfc2396E" href="mailto:storchaka@gmail.com"><storchaka@gmail.com></a><br><b>CC:</b> <a class="moz-txt-link-abbreviated" href="mailto:python-ideas@python.org">python-ideas@python.org</a><br><b>Subject:</b>
[Python-ideas] for line in input with open(path) as input...<br></font></div>
</font></div></div>
<div style="color:#888888;margin-left:24px;margin-right:24px;"
__pbrmquotes="true" class="__pbConvBody">
iterwith() doesn't need
to: __exit__() is invoked automatically when iteration completes and the
loop exits. <br>
</div>
<br>
<blockquote class="__pbForwardBlockQuote" style="border: 0px none;"
cite="mid:510D1C4B.1020806@umbrellacode.com" type="cite"><span
style="color: rgb(0, 0, 0);">I hadn't thought about the
fact the context was created inside the generator... Nonetheless,
cleanup would be automatic, always; and the generator should exit
eventually on close() if not exhausted, I believe (need to review the
details on gen cleanup). </span><br style="color: rgb(0, 0, 0);">
<div style="color:#888888;margin-left:24px;margin-right:24px;"
__pbrmquotes="true" class="__pbConvBody">
<br>
</div>
<br>
<br>
<div style="color:#888888;margin-left:24px;margin-right:24px;"
__pbrmquotes="true" class="__pbConvBody">
<br>
<br>_______________________________________________
<br>Python-ideas mailing list
<br><a class="moz-txt-link-abbreviated" href="mailto:Python-ideas@python.org">Python-ideas@python.org</a>
<br><a class="moz-txt-link-freetext" href="http://mail.python.org/mailman/listinfo/python-ideas">http://mail.python.org/mailman/listinfo/python-ideas</a>
<br></div>
<br>
</blockquote>
</body></html>